This repository was archived by the owner on Nov 20, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 191
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4637a95
#266 Consolidate authentication APIs.
Tratcher a174bb2
#270 Rename auth wrapper's internal collections to Items.
Tratcher cc1a24b
#273 - Use POCOs for auth context objects.
Tratcher 0ed2692
#267, #273, Move WebSocket APIs to their own object, fix context object.
Tratcher 06e24a8
Handle null auth, null descriptions.
Tratcher 43a38c1
Reorder Challenge parameters.
Tratcher File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
src/Microsoft.AspNet.Http.Core/Authentication/AuthenticationManager.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. | ||
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. | ||
|
||
using System.Collections.Generic; | ||
using System.Security.Claims; | ||
using System.Threading.Tasks; | ||
|
||
namespace Microsoft.AspNet.Http.Authentication | ||
{ | ||
public abstract class AuthenticationManager | ||
{ | ||
public abstract IEnumerable<AuthenticationDescription> GetAuthenticationSchemes(); | ||
|
||
public abstract AuthenticationResult Authenticate(string authenticationScheme); | ||
|
||
public abstract Task<AuthenticationResult> AuthenticateAsync(string authenticationScheme); | ||
|
||
public virtual void Challenge() | ||
{ | ||
Challenge(properties: null, authenticationScheme: null); | ||
} | ||
|
||
public virtual void Challenge(AuthenticationProperties properties) | ||
{ | ||
Challenge(properties, ""); | ||
} | ||
|
||
public virtual void Challenge(string authenticationScheme) | ||
{ | ||
Challenge(properties: null, authenticationScheme: authenticationScheme); | ||
} | ||
|
||
public abstract void Challenge(AuthenticationProperties properties, string authenticationScheme); | ||
|
||
public abstract void SignIn(string authenticationScheme, ClaimsPrincipal principal, AuthenticationProperties properties = null); | ||
|
||
public virtual void SignOut() | ||
{ | ||
SignOut(authenticationScheme: null, properties: null); | ||
} | ||
|
||
public abstract void SignOut(string authenticationScheme); | ||
|
||
public abstract void SignOut(string authenticationScheme, AuthenticationProperties properties); | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Brent's issue, we should probably switch scheme to be the first parameter here to be consistent with sign in/signout