Table of Contents

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

httpContextAccessor IHttpContextAccessor

Reaches the request whose browser-state cookie is read and written.

options IOptions<IdentityServerOptions>

The server options; the browser-state cookie's name and domain are in their Authentication section.

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

clientId string
redirectUri string
sessionId string

Returns

string

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

clientId or redirectUri is null or empty.

RemoveBrowserState()

Clears the browser state, so every relying party polling sees a change.

public void RemoveBrowserState()