Class ConfigureCookieWithTicketStoreAuthenticationOptions
Configures the authentication cookie so the session is kept in an ITicketStore. It is registered (with TryAddSingleton) by
AddOidcAuthentication and AddHybridAuthentication when AuthenticationCacheTicketStoreOption is set;
another IPostConfigureOptions<TOptions> of the cookie options registered before replaces it.
public class ConfigureCookieWithTicketStoreAuthenticationOptions : IPostConfigureOptions<CookieAuthenticationOptions>
- Inheritance
-
ConfigureCookieWithTicketStoreAuthenticationOptions
- Implements
- Inherited Members
Constructors
ConfigureCookieWithTicketStoreAuthenticationOptions(ITicketStore, IOptionsMonitor<OidcAuthenticationOptions>)
Initializes a new instance of the ConfigureCookieWithTicketStoreAuthenticationOptions class.
public ConfigureCookieWithTicketStoreAuthenticationOptions(ITicketStore ticketStore, IOptionsMonitor<OidcAuthenticationOptions> optionsMonitor)
Parameters
ticketStoreITicketStoreThe store in which the authentication tickets are kept.
optionsMonitorIOptionsMonitor<OidcAuthenticationOptions>The OpenID Connect authentication options.
ConfigureCookieWithTicketStoreAuthenticationOptions(ITicketStore, IOptionsMonitor<OidcAuthenticationOptions>, ILogger<ConfigureCookieWithTicketStoreAuthenticationOptions>)
Initializes a new instance of the ConfigureCookieWithTicketStoreAuthenticationOptions class.
public ConfigureCookieWithTicketStoreAuthenticationOptions(ITicketStore ticketStore, IOptionsMonitor<OidcAuthenticationOptions> optionsMonitor, ILogger<ConfigureCookieWithTicketStoreAuthenticationOptions> logger)
Parameters
ticketStoreITicketStoreThe store in which the authentication tickets are kept.
optionsMonitorIOptionsMonitor<OidcAuthenticationOptions>The OpenID Connect authentication options.
loggerILogger<ConfigureCookieWithTicketStoreAuthenticationOptions>The logger warning about a cookie name without the
__Host-prefix.
Methods
PostConfigure(string?, CookieAuthenticationOptions)
Configures the cookie: the ticket store keeps the session, the name comes from CookieName, the expiration is the shorter of
AuthenticationTicketTtl and RefreshTokenLifetime (sliding), and the cookie is essential, SameSite=Lax,
secure, host-only and valid for the whole site (Path=/). A sign-in always starts a new session (see FreshSessionCookieManager).
public void PostConfigure(string? name, CookieAuthenticationOptions options)
Parameters
namestringThe name of the options instance.
optionsCookieAuthenticationOptionsThe cookie options to configure.