Class SessionStateService
- Namespace
- Fdyay.IdentityServer.Services
- Assembly
- Fdyay.IdentityServer.AspNetCore.dll
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
public sealed class SessionStateService : ISessionStateService
- Inheritance
-
SessionStateService
- Implements
- Inherited Members
Constructors
SessionStateService(IHttpContextAccessor, IOptions<IdentityServerOptions>)
Creates the service, as the container resolves it.
public SessionStateService(IHttpContextAccessor httpContextAccessor, IOptions<IdentityServerOptions> options)
Parameters
httpContextAccessorIHttpContextAccessorReaches the request whose browser-state cookie is read and written.
optionsIOptions<IdentityServerOptions>The server options; the browser-state cookie's name and domain are in their
Authenticationsection.
Methods
GetSessionState(string, string, string?)
Computes the session_state for an authorization response, issuing the browser-state cookie if the
session does not have one yet. Null when there is no session to report on.
public string? GetSessionState(string clientId, string redirectUri, string? sessionId)
Parameters
Returns
Remarks
The value is {hash}.{salt}: the SHA-256 of the client id, the redirect URI's origin, the browser state and a
random salt, Base64Url-encoded. Null as well when there is no request or the redirect URI has no origin.
Exceptions
- ArgumentException
clientIdorredirectUriis null or empty.
RemoveBrowserState()
Clears the browser state, so every relying party polling sees a change.
public void RemoveBrowserState()