Class StandardOpenIdConnectEvents
The default OpenIdConnectEvents. It validates the audience and the issuer of the access token received from the token endpoint (the issuer must be Issuer of the default authority when it is set, or the issuer of its metadata otherwise), forces https redirect urls (except for localhost), adds the extra authorization and token request parameters (see ApiExtraContextAuthenticationOption), and answers failures with a simple html message.
public sealed class StandardOpenIdConnectEvents : OpenIdConnectEvents
- Inheritance
-
StandardOpenIdConnectEvents
- Inherited Members
Constructors
StandardOpenIdConnectEvents(ILogger<StandardOpenIdConnectEvents>, IOptionsMonitor<OidcAuthenticationOptions>, IOptionsMonitor<SimpleKeyValueSettings>, IOptionsMonitor<ApiExtraContextAuthenticationOption>)
Initializes a new instance of the StandardOpenIdConnectEvents class.
public StandardOpenIdConnectEvents(ILogger<StandardOpenIdConnectEvents> logger, IOptionsMonitor<OidcAuthenticationOptions> oidcOptions, IOptionsMonitor<SimpleKeyValueSettings> openIdOptions, IOptionsMonitor<ApiExtraContextAuthenticationOption> extraContextOptions)
Parameters
loggerILogger<StandardOpenIdConnectEvents>The logger.
oidcOptionsIOptionsMonitor<OidcAuthenticationOptions>The OpenID Connect authentication options.
openIdOptionsIOptionsMonitor<SimpleKeyValueSettings>The named OpenID settings.
extraContextOptionsIOptionsMonitor<ApiExtraContextAuthenticationOption>The extra parameters added to the authorization and token requests.
Methods
AccessDenied(AccessDeniedContext)
Invoked when an access denied error was returned by the remote server.
public override Task AccessDenied(AccessDeniedContext context)
Parameters
contextAccessDeniedContext
Returns
AuthenticationFailed(AuthenticationFailedContext)
Invoked if exceptions are thrown during request processing. The exceptions will be re-thrown after this event unless suppressed.
public override Task AuthenticationFailed(AuthenticationFailedContext context)
Parameters
contextAuthenticationFailedContext
Returns
AuthorizationCodeReceived(AuthorizationCodeReceivedContext)
Invoked if an authorization code is present in the protocol message.
public override Task AuthorizationCodeReceived(AuthorizationCodeReceivedContext context)
Parameters
contextAuthorizationCodeReceivedContext
Returns
RedirectToIdentityProvider(RedirectContext)
Invoked before redirecting to the identity provider to authenticate. This can be used to set ProtocolMessage.State that will be persisted through the authentication process. The ProtocolMessage can also be used to add or customize parameters sent to the identity provider.
public override Task RedirectToIdentityProvider(RedirectContext context)
Parameters
contextRedirectContext
Returns
RemoteFailure(RemoteFailureContext)
Invoked when there is a remote failure.
public override Task RemoteFailure(RemoteFailureContext context)
Parameters
contextRemoteFailureContext
Returns
TokenResponseReceived(TokenResponseReceivedContext)
Invoked after an authorization code is redeemed for tokens at the token endpoint.
public override Task TokenResponseReceived(TokenResponseReceivedContext context)
Parameters
contextTokenResponseReceivedContext