Class DistributedIDCache
- Namespace
- ComponentSpace.Saml2.Cache
- Assembly
- ComponentSpace.Saml2.dll
The distributed ID cache stores IDs in a distributed cache.
The distributed ID cache is suitable for applications deployed to a web farm.
public class DistributedIDCache : IIDCache
- Inheritance
-
DistributedIDCache
- Implements
- Inherited Members
Constructors
DistributedIDCache(IDistributedCache, ILoggerFactory)
Initializes a new instance of the DistributedIDCache class.
public DistributedIDCache(IDistributedCache distributedCache, ILoggerFactory loggerFactory)
Parameters
distributedCacheIDistributedCacheThe distributed cache used to store IDs.
loggerFactoryILoggerFactoryThe logger factory.
Methods
AddAsync(string, DateTime)
Adds the ID with an associated expiration time to the cache.
public Task<bool> AddAsync(string id, DateTime expirationDateTime)
Parameters
Returns
- Task<bool>
A task that represents the add operation and returns
trueif the ID already exists in the cache; otherwisefalse.
Exceptions
- SamlEnvironmentException
Thrown if the ID cannot be added to the cache.
RemoveAsync(string)
Removes the ID from the cache.
public Task RemoveAsync(string id)
Parameters
idstringThe ID.
Returns
- Task
A task that represents the remove operation.
Exceptions
- SamlEnvironmentException
Thrown if the ID cannot be added to the cache.