Class SessionStore
The OpenID session store implemented using a cache and a cookie.
Implements
Inherited Members
Namespace: ComponentSpace.OpenID.Session
Assembly: ComponentSpace.OpenID.dll
Syntax
public class SessionStore : ISessionStore
Constructors
SessionStore(IOptionsMonitor<SessionStoreOptions>, IIDGenerator, ICache, IHttpContextAccessor, ILoggerFactory)
Constructs a SessionStore.
Declaration
public SessionStore(IOptionsMonitor<SessionStoreOptions> sessionStoreOptions, IIDGenerator idGenerator, ICache cache, IHttpContextAccessor httpContextAccessor, ILoggerFactory loggerFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| IOptionsMonitor<SessionStoreOptions> | sessionStoreOptions | The session store options. |
| IIDGenerator | idGenerator | The ID generator. |
| ICache | cache | The cache used to store OpenID session state. |
| IHttpContextAccessor | httpContextAccessor | The HTTP context accessor. |
| ILoggerFactory | loggerFactory | The logger factory. |
Properties
SessionID
Gets the unique OpenID session identifier.
Declaration
public virtual string? SessionID { get; set; }
Property Value
| Type | Description |
|---|---|
| string | The unique OpenID session identifier. |
Methods
AddCookie(string, string, CookieOptions)
Adds the OpenID session cookie to the HTTP response.
Declaration
protected virtual void AddCookie(string cookieName, string cookieValue, CookieOptions cookieOptions)
Parameters
| Type | Name | Description |
|---|---|---|
| string | cookieName | The cookie name. |
| string | cookieValue | The cookie value. |
| CookieOptions | cookieOptions | The cookie options. |
LoadAsync<T>()
Loads the OpenID session object.
Declaration
public virtual Task<T?> LoadAsync<T>()
Returns
| Type | Description |
|---|---|
| Task<T> | A task that represents the operation and returns the OpenID session object or |
Type Parameters
| Name | Description |
|---|---|
| T |
RefreshAsync<T>()
Refreshes the OpenID session object so the sliding expiration is reset.
Declaration
public virtual Task RefreshAsync<T>()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the operation. |
Type Parameters
| Name | Description |
|---|---|
| T |
RemoveAsync<T>()
Removes the OpenID session object.
Declaration
public virtual Task RemoveAsync<T>()
Returns
| Type | Description |
|---|---|
| Task | A task that represents the operation. |
Type Parameters
| Name | Description |
|---|---|
| T |
SaveAsync(object)
Saves the OpenID session object.
Declaration
public virtual Task SaveAsync(object session)
Parameters
| Type | Name | Description |
|---|---|---|
| object | session | The OpenID session object. |
Returns
| Type | Description |
|---|---|
| Task | A task that represents the operation. |