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
TToken
The type of the Token entity.
Methods
AddAsync(TToken, CancellationToken)
Add the specified token to the cache.
ValueTask AddAsync(TToken token, CancellationToken cancellationToken)
Parameters
token
TTokenThe token to add to the cache.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the token.
client
stringThe client associated with the token.
status
stringThe token status.
type
stringThe token type.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the token.
client
stringThe client associated with the token.
status
stringThe token status.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the token.
client
stringThe client associated with the token.
cancellationToken
CancellationTokenThe 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
identifier
stringThe application identifier associated with the tokens.
cancellationToken
CancellationTokenThe 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
identifier
stringThe authorization identifier associated with the tokens.
cancellationToken
CancellationTokenThe 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
identifier
stringThe unique identifier associated with the token.
cancellationToken
CancellationTokenThe 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
identifier
stringThe reference identifier associated with the tokens.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the tokens.
cancellationToken
CancellationTokenThe 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
token
TTokenThe token to remove from the cache.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.