Class StandardCookieEvents
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
serviceProviderIServiceProviderThe service provider used to resolve the scoped TokenRefreshInfo.
loggerILogger<StandardCookieEvents>The logger.
oidcOptionsIOptions<OidcAuthenticationOptions>The OpenID Connect authentication options.
tokenRefreshProviderITokenRefreshProviderThe provider that refreshes the tokens.
Methods
ValidatePrincipal(CookieValidatePrincipalContext)
Invoked to validate the principal.
public override Task ValidatePrincipal(CookieValidatePrincipalContext cookieCtx)
Parameters
cookieCtxCookieValidatePrincipalContext