AuthenticationHandler<TOptions> AuthenticationHandler<TOptions> AuthenticationHandler<TOptions> AuthenticationHandler<TOptions> Class

Definition

Base class for the per-request work performed by most authentication middleware.

generic <typename TOptions>
 where TOptions : AuthenticationSchemeOptionsgcnew()public ref class AuthenticationHandler abstract : Microsoft::AspNetCore::Authentication::IAuthenticationHandler
public abstract class AuthenticationHandler<TOptions> : Microsoft.AspNetCore.Authentication.IAuthenticationHandler where TOptions : AuthenticationSchemeOptionsnew()
type AuthenticationHandler<'Options (requires 'Options :> AuthenticationSchemeOptions and 'Options : (new : unit -> 'Options))> = class
    interface IAuthenticationHandler
Public MustInherit Class AuthenticationHandler(Of TOptions)
Implements IAuthenticationHandler
Type Parameters
TOptions

Specifies which type for of AuthenticationOptions property

Inheritance
AuthenticationHandler<TOptions>AuthenticationHandler<TOptions>AuthenticationHandler<TOptions>AuthenticationHandler<TOptions>
Derived
Implements

Constructors

AuthenticationHandler<TOptions>() AuthenticationHandler<TOptions>() AuthenticationHandler<TOptions>() AuthenticationHandler<TOptions>()
AuthenticationHandler<TOptions>(IOptionsMonitor<TOptions>, ILoggerFactory, UrlEncoder, ISystemClock) AuthenticationHandler<TOptions>(IOptionsMonitor<TOptions>, ILoggerFactory, UrlEncoder, ISystemClock) AuthenticationHandler<TOptions>(IOptionsMonitor<TOptions>, ILoggerFactory, UrlEncoder, ISystemClock) AuthenticationHandler<TOptions>(IOptionsMonitor<TOptions>, ILoggerFactory, UrlEncoder, ISystemClock)

Properties

ChallengeCalled ChallengeCalled ChallengeCalled ChallengeCalled
ClaimsIssuer ClaimsIssuer ClaimsIssuer ClaimsIssuer
Clock Clock Clock Clock
Context Context Context Context
CurrentUri CurrentUri CurrentUri CurrentUri
Events Events Events Events

The handler calls methods on the events which give the application control at certain points where processing is occurring. If it is not provided a default instance is supplied which does nothing when the methods are called.

InitializeResult InitializeResult InitializeResult InitializeResult
Logger Logger Logger Logger
Options Options Options Options
OptionsMonitor OptionsMonitor OptionsMonitor OptionsMonitor
OriginalPath OriginalPath OriginalPath OriginalPath
OriginalPathBase OriginalPathBase OriginalPathBase OriginalPathBase
PriorHandler PriorHandler PriorHandler PriorHandler
Request Request Request Request
Response Response Response Response
Scheme Scheme Scheme Scheme
SignInAccepted SignInAccepted SignInAccepted SignInAccepted
SignOutAccepted SignOutAccepted SignOutAccepted SignOutAccepted
UrlEncoder UrlEncoder UrlEncoder UrlEncoder

Methods

AuthenticateAsync() AuthenticateAsync() AuthenticateAsync() AuthenticateAsync()
AuthenticateAsync(AuthenticateContext) AuthenticateAsync(AuthenticateContext) AuthenticateAsync(AuthenticateContext) AuthenticateAsync(AuthenticateContext)
BuildRedirectUri(String) BuildRedirectUri(String) BuildRedirectUri(String) BuildRedirectUri(String)
ChallengeAsync(AuthenticationProperties) ChallengeAsync(AuthenticationProperties) ChallengeAsync(AuthenticationProperties) ChallengeAsync(AuthenticationProperties)
ChallengeAsync(ChallengeContext) ChallengeAsync(ChallengeContext) ChallengeAsync(ChallengeContext) ChallengeAsync(ChallengeContext)
CreateEventsAsync() CreateEventsAsync() CreateEventsAsync() CreateEventsAsync()

Creates a new instance of the events instance.

FinishResponseAsync() FinishResponseAsync() FinishResponseAsync() FinishResponseAsync()

Hook that is called when the response about to be sent

ForbidAsync(AuthenticationProperties) ForbidAsync(AuthenticationProperties) ForbidAsync(AuthenticationProperties) ForbidAsync(AuthenticationProperties)
GetDescriptions(DescribeSchemesContext) GetDescriptions(DescribeSchemesContext) GetDescriptions(DescribeSchemesContext) GetDescriptions(DescribeSchemesContext)
HandleAuthenticateAsync() HandleAuthenticateAsync() HandleAuthenticateAsync() HandleAuthenticateAsync()
HandleAuthenticateOnceAsync() HandleAuthenticateOnceAsync() HandleAuthenticateOnceAsync() HandleAuthenticateOnceAsync()

Used to ensure HandleAuthenticateAsync is only invoked once. The subsequent calls will return the same authenticate result.

HandleAuthenticateOnceSafeAsync() HandleAuthenticateOnceSafeAsync() HandleAuthenticateOnceSafeAsync() HandleAuthenticateOnceSafeAsync()

Used to ensure HandleAuthenticateAsync is only invoked once safely. The subsequent calls will return the same authentication result. Any exceptions will be converted into a failed authentication result containing the exception.

HandleChallengeAsync(AuthenticationProperties) HandleChallengeAsync(AuthenticationProperties) HandleChallengeAsync(AuthenticationProperties) HandleChallengeAsync(AuthenticationProperties)

Override this method to deal with 401 challenge concerns, if an authentication scheme in question deals an authentication interaction as part of it's request flow. (like adding a response header, or changing the 401 result to 302 of a login page or external sign-in location.)

HandleForbiddenAsync(AuthenticationProperties) HandleForbiddenAsync(AuthenticationProperties) HandleForbiddenAsync(AuthenticationProperties) HandleForbiddenAsync(AuthenticationProperties)

Override this method to handle Forbid.

HandleForbiddenAsync(ChallengeContext) HandleForbiddenAsync(ChallengeContext) HandleForbiddenAsync(ChallengeContext) HandleForbiddenAsync(ChallengeContext)

Override this method to deal with a challenge that is forbidden.

HandleRequestAsync() HandleRequestAsync() HandleRequestAsync() HandleRequestAsync()

Called once by common code after initialization. If an authentication middleware responds directly to specifically known paths it must override this virtual, compare the request path to it's known paths, provide any response information as appropriate, and true to stop further processing.

HandleSignInAsync(SignInContext) HandleSignInAsync(SignInContext) HandleSignInAsync(SignInContext) HandleSignInAsync(SignInContext)
HandleSignOutAsync(SignOutContext) HandleSignOutAsync(SignOutContext) HandleSignOutAsync(SignOutContext) HandleSignOutAsync(SignOutContext)
HandleUnauthorizedAsync(ChallengeContext) HandleUnauthorizedAsync(ChallengeContext) HandleUnauthorizedAsync(ChallengeContext) HandleUnauthorizedAsync(ChallengeContext)

Override this method to deal with 401 challenge concerns, if an authentication scheme in question deals an authentication interaction as part of it's request flow. (like adding a response header, or changing the 401 result to 302 of a login page or external sign-in location.)

InitializeAsync(AuthenticationScheme, HttpContext) InitializeAsync(AuthenticationScheme, HttpContext) InitializeAsync(AuthenticationScheme, HttpContext) InitializeAsync(AuthenticationScheme, HttpContext)

Initialize the handler, resolve the options and validate them.

InitializeAsync(TOptions, HttpContext, ILogger, UrlEncoder) InitializeAsync(TOptions, HttpContext, ILogger, UrlEncoder) InitializeAsync(TOptions, HttpContext, ILogger, UrlEncoder) InitializeAsync(TOptions, HttpContext, ILogger, UrlEncoder)

Initialize is called once per request to contextualize this instance with appropriate state.

InitializeEventsAsync() InitializeEventsAsync() InitializeEventsAsync() InitializeEventsAsync()

Initializes the events object, called once per request by InitializeAsync(AuthenticationScheme, HttpContext).

InitializeHandlerAsync() InitializeHandlerAsync() InitializeHandlerAsync() InitializeHandlerAsync()

Called after options/events have been initialized for the handler to finish initializing itself.

ResolveTarget(String) ResolveTarget(String) ResolveTarget(String) ResolveTarget(String)
ShouldHandleScheme(String, Boolean) ShouldHandleScheme(String, Boolean) ShouldHandleScheme(String, Boolean) ShouldHandleScheme(String, Boolean)
SignInAsync(SignInContext) SignInAsync(SignInContext) SignInAsync(SignInContext) SignInAsync(SignInContext)
SignOutAsync(SignOutContext) SignOutAsync(SignOutContext) SignOutAsync(SignOutContext) SignOutAsync(SignOutContext)

Applies to