OpenIdConnectHandler OpenIdConnectHandler OpenIdConnectHandler Class

Definition

A per-request authentication handler for the OpenIdConnectAuthenticationMiddleware.

public class OpenIdConnectHandler : Microsoft.AspNetCore.Authentication.RemoteAuthenticationHandler<Microsoft.AspNetCore.Authentication.OpenIdConnect.OpenIdConnectOptions>, Microsoft.AspNetCore.Authentication.IAuthenticationSignOutHandler
type OpenIdConnectHandler = class
    inherit RemoteAuthenticationHandler<OpenIdConnectOptions>
    interface IAuthenticationSignOutHandler
    interface IAuthenticationHandler
Public Class OpenIdConnectHandler
Inherits RemoteAuthenticationHandler(Of OpenIdConnectOptions)
Implements IAuthenticationSignOutHandler
Inheritance
Implements

Constructors

OpenIdConnectHandler(HttpClient, HtmlEncoder) OpenIdConnectHandler(HttpClient, HtmlEncoder) OpenIdConnectHandler(HttpClient, HtmlEncoder)
OpenIdConnectHandler(IOptionsMonitor<OpenIdConnectOptions>, ILoggerFactory, HtmlEncoder, UrlEncoder, ISystemClock) OpenIdConnectHandler(IOptionsMonitor<OpenIdConnectOptions>, ILoggerFactory, HtmlEncoder, UrlEncoder, ISystemClock) OpenIdConnectHandler(IOptionsMonitor<OpenIdConnectOptions>, ILoggerFactory, HtmlEncoder, UrlEncoder, ISystemClock)

Properties

Backchannel Backchannel Backchannel
ChallengeCalled ChallengeCalled ChallengeCalled Inherited from AuthenticationHandler<TOptions>
ClaimsIssuer ClaimsIssuer ClaimsIssuer Inherited from AuthenticationHandler<TOptions>
Clock Clock Clock Inherited from AuthenticationHandler<TOptions>
Context Context Context Inherited from AuthenticationHandler<TOptions>
CurrentUri CurrentUri CurrentUri Inherited from AuthenticationHandler<TOptions>
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.

HtmlEncoder HtmlEncoder HtmlEncoder
InitializeResult InitializeResult InitializeResult Inherited from AuthenticationHandler<TOptions>
Logger Logger Logger Inherited from AuthenticationHandler<TOptions>
Options Options Options Inherited from AuthenticationHandler<TOptions>
OptionsMonitor OptionsMonitor OptionsMonitor Inherited from AuthenticationHandler<TOptions>
OriginalPath OriginalPath OriginalPath Inherited from AuthenticationHandler<TOptions>
OriginalPathBase OriginalPathBase OriginalPathBase Inherited from AuthenticationHandler<TOptions>
PriorHandler PriorHandler PriorHandler Inherited from AuthenticationHandler<TOptions>
Request Request Request Inherited from AuthenticationHandler<TOptions>
Response Response Response Inherited from AuthenticationHandler<TOptions>
Scheme Scheme Scheme Inherited from AuthenticationHandler<TOptions>
SignInAccepted SignInAccepted SignInAccepted Inherited from AuthenticationHandler<TOptions>
SignInScheme SignInScheme SignInScheme Inherited from RemoteAuthenticationHandler<TOptions>
SignOutAccepted SignOutAccepted SignOutAccepted Inherited from AuthenticationHandler<TOptions>
UrlEncoder UrlEncoder UrlEncoder Inherited from AuthenticationHandler<TOptions>

Methods

AuthenticateAsync() AuthenticateAsync() AuthenticateAsync() Inherited from AuthenticationHandler<TOptions>
AuthenticateAsync(AuthenticateContext) AuthenticateAsync(AuthenticateContext) AuthenticateAsync(AuthenticateContext) Inherited from AuthenticationHandler<TOptions>
BuildRedirectUri(String) BuildRedirectUri(String) BuildRedirectUri(String) Inherited from AuthenticationHandler<TOptions>
ChallengeAsync(AuthenticationProperties) ChallengeAsync(AuthenticationProperties) ChallengeAsync(AuthenticationProperties) Inherited from AuthenticationHandler<TOptions>
ChallengeAsync(ChallengeContext) ChallengeAsync(ChallengeContext) ChallengeAsync(ChallengeContext) Inherited from AuthenticationHandler<TOptions>
CreateEventsAsync() CreateEventsAsync() CreateEventsAsync()
FinishResponseAsync() FinishResponseAsync() FinishResponseAsync()

Hook that is called when the response about to be sent

(Inherited from AuthenticationHandler<TOptions>)
ForbidAsync(AuthenticationProperties) ForbidAsync(AuthenticationProperties) ForbidAsync(AuthenticationProperties) Inherited from AuthenticationHandler<TOptions>
GenerateCorrelationId(AuthenticationProperties) GenerateCorrelationId(AuthenticationProperties) GenerateCorrelationId(AuthenticationProperties) Inherited from RemoteAuthenticationHandler<TOptions>
GenerateCorrelationId(AuthenticationProperties) GenerateCorrelationId(AuthenticationProperties) GenerateCorrelationId(AuthenticationProperties) Inherited from RemoteAuthenticationHandler<TOptions>
GetDescriptions(DescribeSchemesContext) GetDescriptions(DescribeSchemesContext) GetDescriptions(DescribeSchemesContext) Inherited from AuthenticationHandler<TOptions>
GetUserInformationAsync(OpenIdConnectMessage, JwtSecurityToken, AuthenticationTicket) GetUserInformationAsync(OpenIdConnectMessage, JwtSecurityToken, AuthenticationTicket) GetUserInformationAsync(OpenIdConnectMessage, JwtSecurityToken, AuthenticationTicket)

Goes to UserInfo endpoint to retrieve additional claims and add any unique claims to the given identity.

GetUserInformationAsync(OpenIdConnectMessage, JwtSecurityToken, ClaimsPrincipal, AuthenticationProperties) GetUserInformationAsync(OpenIdConnectMessage, JwtSecurityToken, ClaimsPrincipal, AuthenticationProperties) GetUserInformationAsync(OpenIdConnectMessage, JwtSecurityToken, ClaimsPrincipal, AuthenticationProperties)

Goes to UserInfo endpoint to retrieve additional claims and add any unique claims to the given identity.

HandleAuthenticateAsync() HandleAuthenticateAsync() HandleAuthenticateAsync() Inherited from RemoteAuthenticationHandler<TOptions>
HandleAuthenticateOnceAsync() HandleAuthenticateOnceAsync() HandleAuthenticateOnceAsync()

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

(Inherited from AuthenticationHandler<TOptions>)
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.

(Inherited from AuthenticationHandler<TOptions>)
HandleChallengeAsync(AuthenticationProperties) HandleChallengeAsync(AuthenticationProperties) HandleChallengeAsync(AuthenticationProperties)

Responds to a 401 Challenge. Sends an OpenIdConnect message to the 'identity authority' to obtain an identity.

HandleForbiddenAsync(AuthenticationProperties) HandleForbiddenAsync(AuthenticationProperties) HandleForbiddenAsync(AuthenticationProperties) Inherited from RemoteAuthenticationHandler<TOptions>
HandleForbiddenAsync(ChallengeContext) HandleForbiddenAsync(ChallengeContext) HandleForbiddenAsync(ChallengeContext) Inherited from RemoteAuthenticationHandler<TOptions>
HandleRemoteAuthenticateAsync() HandleRemoteAuthenticateAsync() HandleRemoteAuthenticateAsync()

Invoked to process incoming OpenIdConnect messages.

HandleRemoteCallbackAsync() HandleRemoteCallbackAsync() HandleRemoteCallbackAsync() Inherited from RemoteAuthenticationHandler<TOptions>
HandleRemoteSignOutAsync() HandleRemoteSignOutAsync() HandleRemoteSignOutAsync()
HandleRequestAsync() HandleRequestAsync() HandleRequestAsync()
HandleSignInAsync(SignInContext) HandleSignInAsync(SignInContext) HandleSignInAsync(SignInContext) Inherited from RemoteAuthenticationHandler<TOptions>
HandleSignOutAsync(SignOutContext) HandleSignOutAsync(SignOutContext) HandleSignOutAsync(SignOutContext)

Redirect user to the identity provider for sign out

HandleSignOutCallbackAsync() HandleSignOutCallbackAsync() HandleSignOutCallbackAsync()

Response to the callback from OpenId provider after session ended.

HandleUnauthorizedAsync(ChallengeContext) HandleUnauthorizedAsync(ChallengeContext) HandleUnauthorizedAsync(ChallengeContext)

Responds to a 401 Challenge. Sends an OpenIdConnect message to the 'identity authority' to obtain an identity.

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

Initialize the handler, resolve the options and validate them.

(Inherited from AuthenticationHandler<TOptions>)
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.

(Inherited from AuthenticationHandler<TOptions>)
InitializeEventsAsync() InitializeEventsAsync() InitializeEventsAsync()

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

(Inherited from AuthenticationHandler<TOptions>)
InitializeHandlerAsync() InitializeHandlerAsync() InitializeHandlerAsync()

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

(Inherited from AuthenticationHandler<TOptions>)
RedeemAuthorizationCodeAsync(OpenIdConnectMessage) RedeemAuthorizationCodeAsync(OpenIdConnectMessage) RedeemAuthorizationCodeAsync(OpenIdConnectMessage)

Redeems the authorization code for tokens at the token endpoint.

ResolveTarget(String) ResolveTarget(String) ResolveTarget(String) Inherited from AuthenticationHandler<TOptions>
ShouldHandleRequestAsync() ShouldHandleRequestAsync() ShouldHandleRequestAsync() Inherited from RemoteAuthenticationHandler<TOptions>
ShouldHandleScheme(String, Boolean) ShouldHandleScheme(String, Boolean) ShouldHandleScheme(String, Boolean) Inherited from AuthenticationHandler<TOptions>
SignInAsync(SignInContext) SignInAsync(SignInContext) SignInAsync(SignInContext) Inherited from AuthenticationHandler<TOptions>
SignOutAsync(AuthenticationProperties) SignOutAsync(AuthenticationProperties) SignOutAsync(AuthenticationProperties)

Redirect user to the identity provider for sign out

SignOutAsync(SignOutContext) SignOutAsync(SignOutContext) SignOutAsync(SignOutContext) Inherited from AuthenticationHandler<TOptions>
ValidateCorrelationId(AuthenticationProperties) ValidateCorrelationId(AuthenticationProperties) ValidateCorrelationId(AuthenticationProperties) Inherited from RemoteAuthenticationHandler<TOptions>
ValidateCorrelationId(AuthenticationProperties) ValidateCorrelationId(AuthenticationProperties) ValidateCorrelationId(AuthenticationProperties) Inherited from RemoteAuthenticationHandler<TOptions>

Applies to