Class CacheTicketStore
- Namespace
- Arc4u.OAuth2.TicketStore
- Assembly
- Arc4u.OAuth2.AspNetCore.Authentication.dll
An ITicketStore that keeps the authentication tickets in an Arc4u cache. Each ticket is stored under a key made of KeyPrefix and a new guid.
public class CacheTicketStore : ITicketStore
- Inheritance
-
CacheTicketStore
- Implements
- Inherited Members
Constructors
CacheTicketStore(ILogger<CacheTicketStore>, ICacheContext, IOptionsMonitor<CacheTicketStoreOptions>)
Initializes a new instance of the CacheTicketStore class.
public CacheTicketStore(ILogger<CacheTicketStore> logger, ICacheContext cacheContext, IOptionsMonitor<CacheTicketStoreOptions> options)
Parameters
loggerILogger<CacheTicketStore>The logger.
cacheContextICacheContextThe context giving access to the registered caches.
optionsIOptionsMonitor<CacheTicketStoreOptions>The options giving the name of the cache and the key prefix. When the cache does not exist, the default cache is used.
Exceptions
- ArgumentNullException
The cache name or the key prefix is null.
Methods
RemoveAsync(string)
Remove the identity associated with the given key.
public Task RemoveAsync(string key)
Parameters
keystringThe key associated with the identity.
Returns
RenewAsync(string, AuthenticationTicket)
Tells the store that the given identity should be updated.
public Task RenewAsync(string key, AuthenticationTicket ticket)
Parameters
keystringticketAuthenticationTicket
Returns
RetrieveAsync(string)
Retrieves an identity from the store for the given key.
public Task<AuthenticationTicket?> RetrieveAsync(string key)
Parameters
keystringThe key associated with the identity.
Returns
- Task<AuthenticationTicket>
The identity associated with the given key, or
nullif not found.
StoreAsync(AuthenticationTicket)
Store the identity ticket and return the associated key.
public Task<string> StoreAsync(AuthenticationTicket ticket)
Parameters
ticketAuthenticationTicketThe identity information to store.