Table of Contents

Class StandardOpenIdConnectEvents

Namespace
Arc4u.OAuth2.Events
Assembly
Arc4u.OAuth2.AspNetCore.Authentication.dll

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

logger ILogger<StandardOpenIdConnectEvents>

The logger.

oidcOptions IOptionsMonitor<OidcAuthenticationOptions>

The OpenID Connect authentication options.

openIdOptions IOptionsMonitor<SimpleKeyValueSettings>

The named OpenID settings.

extraContextOptions IOptionsMonitor<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

context AccessDeniedContext

Returns

Task

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

context AuthenticationFailedContext

Returns

Task

AuthorizationCodeReceived(AuthorizationCodeReceivedContext)

Invoked if an authorization code is present in the protocol message.

public override Task AuthorizationCodeReceived(AuthorizationCodeReceivedContext context)

Parameters

context AuthorizationCodeReceivedContext

Returns

Task

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

context RedirectContext

Returns

Task

RemoteFailure(RemoteFailureContext)

Invoked when there is a remote failure.

public override Task RemoteFailure(RemoteFailureContext context)

Parameters

context RemoteFailureContext

Returns

Task

TokenResponseReceived(TokenResponseReceivedContext)

Invoked after an authorization code is redeemed for tokens at the token endpoint.

public override Task TokenResponseReceived(TokenResponseReceivedContext context)

Parameters

context TokenResponseReceivedContext

Returns

Task