Table of Contents

Class ApplicationCache

Namespace
Arc4u.OAuth2.Token
Assembly
Arc4u.OAuth2.dll

An ITokenCache that stores the tokens in the cache designated by CacheName (the default cache when the name is empty or unknown). The keys are lower-cased and suffixed with _TokenCache.

[Export(typeof(ITokenCache))]
[Shared]
public class ApplicationCache : ITokenCache
Inheritance
ApplicationCache
Implements
Inherited Members

Constructors

ApplicationCache(ICacheHelper, ILogger, IOptions<TokenCacheOptions>)

An ITokenCache that stores the tokens in the cache designated by CacheName (the default cache when the name is empty or unknown). The keys are lower-cased and suffixed with _TokenCache.

public ApplicationCache(ICacheHelper cacheHelper, ILogger logger, IOptions<TokenCacheOptions> options)

Parameters

cacheHelper ICacheHelper
logger ILogger
options IOptions<TokenCacheOptions>

Methods

DeleteItem(string)

Removes the entry stored for the key. The claims cached by the claims filler are stored under another key and are not removed.

public void DeleteItem(string key)

Parameters

key string

The key of the token.

GetAll()

Not supported.

public IEnumerable<byte[]> GetAll()

Returns

IEnumerable<byte[]>

Never returns.

Exceptions

NotImplementedException

Always thrown.

Get<T>(string)

Gets a value.

public T? Get<T>(string key)

Parameters

key string

The unique key.

Returns

T

The value, or the default of T when there is none.

Type Parameters

T

The type of the value.

Put<T>(string, T)

Adds or replaces a value.

public void Put<T>(string key, T data)

Parameters

key string

The unique key.

data T

The value to store. A null value is ignored by some implementations.

Type Parameters

T

The type of the value.