Table of Contents

Class DistributedSsoSessionStore

Namespace
ComponentSpace.Saml2.Session
Assembly
ComponentSpace.Saml2.dll

The single sign-on session store implemented using a distributed cache and a cookie.

public class DistributedSsoSessionStore : ISsoSessionStore
Inheritance
DistributedSsoSessionStore
Implements
Inherited Members

Constructors

DistributedSsoSessionStore(IOptionsMonitor<DistributedSsoSessionStoreOptions>, IDistributedCache, IHttpRequest, IHttpResponse, ILoggerFactory)

Initializes a new instance of the DistributedSsoSessionStore class.

public DistributedSsoSessionStore(IOptionsMonitor<DistributedSsoSessionStoreOptions> distributedSsoSessionStoreOptions, IDistributedCache distributedCache, IHttpRequest request, IHttpResponse response, ILoggerFactory loggerFactory)

Parameters

distributedSsoSessionStoreOptions IOptionsMonitor<DistributedSsoSessionStoreOptions>

The distributed SSO session store options.

distributedCache IDistributedCache

The distributed cache used to store single sign-on session state.

request IHttpRequest

The HTTP request.

response IHttpResponse

The HTTP response.

loggerFactory ILoggerFactory

The logger factory.

Properties

Request

Gets the HTTP request.

protected IHttpRequest Request { get; }

Property Value

IHttpRequest

The HTTP request.

Response

Gets the HTTP response.

protected IHttpResponse Response { get; }

Property Value

IHttpResponse

The HTTP response.

SessionID

Gets the unique SSO session identifier.

public virtual string SessionID { get; }

Property Value

string

The unique SSO session identifier.

Methods

AddCookie(string, string, CookieOptions)

Adds the SAML session cookie to the HTTP response.

protected virtual void AddCookie(string cookieName, string cookieValue, CookieOptions cookieOptions)

Parameters

cookieName string

The cookie name.

cookieValue string

The cookie value.

cookieOptions CookieOptions

The cookie options.

LoadAsync<T>()

Loads the SSO session object.

public virtual Task<T> LoadAsync<T>()

Returns

Task<T>

A task that represents the operation and returns the SSO session object or null if none.

Type Parameters

T

RefreshAsync<T>()

Refreshes the SSO session object so the sliding expiration is reset.

public virtual Task RefreshAsync<T>()

Returns

Task

A task that represents the operation.

Type Parameters

T

RemoveAsync<T>()

Removes the SSO session object.

public virtual Task RemoveAsync<T>()

Returns

Task

A task that represents the operation.

Type Parameters

T

SaveAsync(object)

Saves the SSO session object.

public virtual Task SaveAsync(object ssoSession)

Parameters

ssoSession object

The SSO session object.

Returns

Task

A task that represents the operation.