Table of Contents

Class StandardCookieEvents

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

The default CookieAuthenticationEvents of the OpenID Connect authentication. On each request it loads the access and refresh tokens stored in the cookie ticket into the scoped TokenRefreshInfo and, when the access token expires in less than ForceRefreshTimeoutTimeSpan, refreshes it and renews the cookie. The access token is also stored in the BootstrapContext of the identity, like the bearer authentication does. The principal is rejected and the user signed out when the cookie is expired or the token cannot be refreshed.

public class StandardCookieEvents : CookieAuthenticationEvents
Inheritance
StandardCookieEvents
Inherited Members

Constructors

StandardCookieEvents(IServiceProvider, ILogger<StandardCookieEvents>, IOptions<OidcAuthenticationOptions>, ITokenRefreshProvider)

Initializes a new instance of the StandardCookieEvents class.

public StandardCookieEvents(IServiceProvider serviceProvider, ILogger<StandardCookieEvents> logger, IOptions<OidcAuthenticationOptions> oidcOptions, ITokenRefreshProvider tokenRefreshProvider)

Parameters

serviceProvider IServiceProvider

The service provider used to resolve the scoped TokenRefreshInfo.

logger ILogger<StandardCookieEvents>

The logger.

oidcOptions IOptions<OidcAuthenticationOptions>

The OpenID Connect authentication options.

tokenRefreshProvider ITokenRefreshProvider

The provider that refreshes the tokens.

Methods

ValidatePrincipal(CookieValidatePrincipalContext)

Invoked to validate the principal.

public override Task ValidatePrincipal(CookieValidatePrincipalContext cookieCtx)

Parameters

cookieCtx CookieValidatePrincipalContext

Returns

Task