Interface IOpenIddictTokenCache<TToken>
- Namespace
- OpenIddict.Abstractions
- Assembly
- OpenIddict.Abstractions.dll
Provides methods allowing to cache tokens after retrieving them from the store.
public interface IOpenIddictTokenCache<TToken> where TToken : class
Type Parameters
TTokenThe type of the Token entity.
Methods
AddAsync(TToken, CancellationToken)
Add the specified token to the cache.
ValueTask AddAsync(TToken token, CancellationToken cancellationToken)
Parameters
tokenTTokenThe token to add to the cache.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
FindAsync(string, string, string, string, CancellationToken)
Retrieves the tokens matching the specified parameters.
IAsyncEnumerable<TToken> FindAsync(string subject, string client, string status, string type, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the token.
clientstringThe client associated with the token.
statusstringThe token status.
typestringThe token type.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TToken>
The tokens corresponding to the criteria.
FindAsync(string, string, string, CancellationToken)
Retrieves the tokens matching the specified parameters.
IAsyncEnumerable<TToken> FindAsync(string subject, string client, string status, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the token.
clientstringThe client associated with the token.
statusstringThe token status.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TToken>
The tokens corresponding to the criteria.
FindAsync(string, string, CancellationToken)
Retrieves the tokens corresponding to the specified subject and associated with the application identifier.
IAsyncEnumerable<TToken> FindAsync(string subject, string client, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the token.
clientstringThe client associated with the token.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TToken>
The tokens corresponding to the subject/client.
FindByApplicationIdAsync(string, CancellationToken)
Retrieves the list of tokens corresponding to the specified application identifier.
IAsyncEnumerable<TToken> FindByApplicationIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifierstringThe application identifier associated with the tokens.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TToken>
The tokens corresponding to the specified application.
FindByAuthorizationIdAsync(string, CancellationToken)
Retrieves the list of tokens corresponding to the specified authorization identifier.
IAsyncEnumerable<TToken> FindByAuthorizationIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifierstringThe authorization identifier associated with the tokens.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TToken>
The tokens corresponding to the specified authorization.
FindByIdAsync(string, CancellationToken)
Retrieves a token using its unique identifier.
ValueTask<TToken?> FindByIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifierstringThe unique identifier associated with the token.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TToken>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the token corresponding to the unique identifier.
FindByReferenceIdAsync(string, CancellationToken)
Retrieves the list of tokens corresponding to the specified reference identifier. Note: the reference identifier may be hashed or encrypted for security reasons.
ValueTask<TToken?> FindByReferenceIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifierstringThe reference identifier associated with the tokens.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TToken>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the tokens corresponding to the specified reference identifier.
FindBySubjectAsync(string, CancellationToken)
Retrieves the list of tokens corresponding to the specified subject.
IAsyncEnumerable<TToken> FindBySubjectAsync(string subject, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the tokens.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TToken>
The tokens corresponding to the specified subject.
RemoveAsync(TToken, CancellationToken)
Removes the specified token from the cache.
ValueTask RemoveAsync(TToken token, CancellationToken cancellationToken)
Parameters
tokenTTokenThe token to remove from the cache.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.