Class SessionStore
The OpenID session store implemented using a cache and a cookie.
Inheritance
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 |
---|---|---|
Microsoft.Extensions.Options.IOptionsMonitor<SessionStoreOptions> | sessionStoreOptions | The session store options. |
IIDGenerator | idGenerator | The ID generator. |
ICache | cache | The cache used to store OpenID session state. |
Microsoft.AspNetCore.Http.IHttpContextAccessor | httpContextAccessor | The HTTP context accessor. |
Microsoft.Extensions.Logging.ILoggerFactory | loggerFactory | The logger factory. |
Properties
SessionID
Gets the unique OpenID session identifier.
Declaration
public virtual string SessionID { get; set; }
Property Value
Type | Description |
---|---|
System.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 |
---|---|---|
System.String | cookieName | The cookie name. |
System.String | cookieValue | The cookie value. |
Microsoft.AspNetCore.Http.CookieOptions | cookieOptions | The cookie options. |
LoadAsync<T>()
Loads the OpenID session object.
Declaration
public virtual async 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 async 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 async 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 async Task SaveAsync(object session)
Parameters
Type | Name | Description |
---|---|---|
System.Object | session | The OpenID session object. |
Returns
Type | Description |
---|---|
Task | A task that represents the operation. |