Table of Contents

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

distributedCache IDistributedCache

The distributed cache used to store IDs.

loggerFactory ILoggerFactory

The 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

id string

The ID.

expirationDateTime DateTime

The expiration time.

Returns

Task<bool>

A task that represents the add operation and returns true if the ID already exists in the cache; otherwise false.

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

id string

The ID.

Returns

Task

A task that represents the remove operation.

Exceptions

SamlEnvironmentException

Thrown if the ID cannot be added to the cache.