Class SessionStoreSignInValidator
Checks the sign-in against the session store of the authentication cookie: the sign-in exists as long as the store still holds the
ticket whose key the principal carries (the SessionKey claim, stamped by SessionKeyTicketStore,
which AddAppPrincipalCircuitRevalidation wraps around the cookie's session store).
public sealed class SessionStoreSignInValidator : ISignInValidator
- Inheritance
-
SessionStoreSignInValidator
- Implements
- Inherited Members
Remarks
Sign-out removes the ticket from the store, and so does its expiry, so the check follows both. The ticket belongs to that sign-in alone: a sign-out ends the circuits of that browser session, not the other sessions of the same user.
The sign-in is ended when the store no longer holds the ticket, when the ticket has expired, or when it belongs to another user. When the principal carries no session key or the cookie has no session store (the whole ticket is then in the cookie, and the server keeps nothing to check against), the sign-in is considered alive: there is nothing to check, and the user keeps the circuit until it reconnects.
Constructors
SessionStoreSignInValidator(IOptionsMonitor<CookieAuthenticationOptions>, IOptions<CircuitRevalidationOptions>, ILogger<SessionStoreSignInValidator>)
Initializes a new instance of the SessionStoreSignInValidator class.
public SessionStoreSignInValidator(IOptionsMonitor<CookieAuthenticationOptions> cookieOptions, IOptions<CircuitRevalidationOptions> options, ILogger<SessionStoreSignInValidator> logger)
Parameters
cookieOptionsIOptionsMonitor<CookieAuthenticationOptions>The cookie options, giving the session store.
optionsIOptions<CircuitRevalidationOptions>The circuit revalidation options, giving the cookie scheme.
loggerILogger<SessionStoreSignInValidator>The logger.
Methods
IsSignInAliveAsync(ClaimsPrincipal, CancellationToken)
Tells whether the sign-in behind user still exists.
public Task<bool> IsSignInAliveAsync(ClaimsPrincipal user, CancellationToken cancellationToken)
Parameters
userClaimsPrincipalThe user of the circuit.
cancellationTokenCancellationTokenA token to cancel the check (the circuit is closing).