Class DistributedSsoSessionStore
The single sign-on session store implemented using a distributed cache and a cookie.
Inheritance
Implements
Inherited Members
Namespace: ComponentSpace.Saml2.Session
Assembly: ComponentSpace.Saml2.dll
Syntax
public class DistributedSsoSessionStore : ISsoSessionStore
Constructors
DistributedSsoSessionStore(IOptionsMonitor<DistributedSsoSessionStoreOptions>, IDistributedCache, IHttpRequest, IHttpResponse, ILoggerFactory)
Initializes a new instance of the DistributedSsoSessionStore
class.
Declaration
public DistributedSsoSessionStore(IOptionsMonitor<DistributedSsoSessionStoreOptions> distributedSsoSessionStoreOptions, IDistributedCache distributedCache, IHttpRequest request, IHttpResponse response, ILoggerFactory loggerFactory)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.Options.IOptionsMonitor<DistributedSsoSessionStoreOptions> | distributedSsoSessionStoreOptions | The distributed SSO session store options. |
Microsoft.Extensions.Caching.Distributed.IDistributedCache | distributedCache | The distributed cache used to store single sign-on session state. |
IHttpRequest | request | The HTTP request. |
IHttpResponse | response | The HTTP response. |
Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The logger factory. |
Properties
Request
Gets the HTTP request.
Declaration
protected IHttpRequest Request { get; }
Property Value
Type | Description |
---|---|
IHttpRequest | The HTTP request. |
Response
Gets the HTTP response.
Declaration
protected IHttpResponse Response { get; }
Property Value
Type | Description |
---|---|
IHttpResponse | The HTTP response. |
SessionID
Gets the unique SSO session identifier.
Declaration
public virtual string SessionID { get; }
Property Value
Type | Description |
---|---|
System.String | The unique SSO session identifier. |
Methods
AddCookie(String, String, CookieOptions)
Adds the SAML session cookie to the HTTP response.
Declaration
protected virtual void AddCookie(string cookieName, string cookieValue, CookieOptions cookieOptions)
Parameters
Type | Name | Description |
---|---|---|
System.String | cookieName | The cookie name. |
System.String | cookieValue | The cookie value. |
CookieOptions | cookieOptions | The cookie options. |
LoadAsync<T>()
Loads the SSO session object.
Declaration
public virtual async Task<T> LoadAsync<T>()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<T> | A task that represents the operation and returns the SSO session object or |
Type Parameters
Name | Description |
---|---|
T |
RefreshAsync<T>()
Refreshes the SSO session object so the sliding expiration is reset.
Declaration
public virtual async Task RefreshAsync<T>()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the operation. |
Type Parameters
Name | Description |
---|---|
T |
RemoveAsync<T>()
Removes the SSO session object.
Declaration
public virtual async Task RemoveAsync<T>()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the operation. |
Type Parameters
Name | Description |
---|---|
T |
SaveAsync(Object)
Saves the SSO session object.
Declaration
public virtual async Task SaveAsync(object ssoSession)
Parameters
Type | Name | Description |
---|---|---|
System.Object | ssoSession | The SSO session object. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the operation. |