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
distributedSsoSessionStoreOptionsIOptionsMonitor<DistributedSsoSessionStoreOptions>The distributed SSO session store options.
distributedCacheIDistributedCacheThe distributed cache used to store single sign-on session state.
requestIHttpRequestThe HTTP request.
responseIHttpResponseThe HTTP response.
loggerFactoryILoggerFactoryThe 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
cookieNamestringThe cookie name.
cookieValuestringThe cookie value.
cookieOptionsCookieOptionsThe 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
nullif 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
ssoSessionobjectThe SSO session object.
Returns
- Task
A task that represents the operation.