Class UnsafeTokenCacheOptions
Options controlling the storage of the token cache.
public abstract class UnsafeTokenCacheOptions : TokenCachePersistenceOptions
- Inheritance
-
UnsafeTokenCacheOptions
- Inherited Members
Constructors
UnsafeTokenCacheOptions()
protected UnsafeTokenCacheOptions()
Methods
RefreshCacheAsync()
Returns the bytes used to initialize the token cache. This would most likely have come from the TokenCacheUpdatedArgs. This implementation will get called by the default implementation of RefreshCacheAsync(TokenCacheRefreshArgs, CancellationToken). It is recommended to provide an implementation for RefreshCacheAsync(TokenCacheRefreshArgs, CancellationToken) rather than this method.
protected abstract Task<ReadOnlyMemory<byte>> RefreshCacheAsync()
Returns
RefreshCacheAsync(TokenCacheRefreshArgs, CancellationToken)
Returns the bytes used to initialize the token cache. This would most likely have come from the TokenCacheUpdatedArgs. It is recommended that if this method is overriden, there is no need to provide a duplicate implementation for the parameterless RefreshCacheAsync().
protected virtual Task<TokenCacheData> RefreshCacheAsync(TokenCacheRefreshArgs args, CancellationToken cancellationToken = default)
Parameters
args
TokenCacheRefreshArgsThe TokenCacheRefreshArgs containing information about the current state of the cache.
cancellationToken
CancellationTokenThe CancellationToken controlling the lifetime of this operation.
Returns
TokenCacheUpdatedAsync(TokenCacheUpdatedArgs)
The delegate to be called when the Updated event fires.
protected abstract Task TokenCacheUpdatedAsync(TokenCacheUpdatedArgs tokenCacheUpdatedArgs)
Parameters
tokenCacheUpdatedArgs
TokenCacheUpdatedArgs