Interface IOpenIddictAuthorizationCache<TAuthorization>
- Namespace
- OpenIddict.Abstractions
- Assembly
- OpenIddict.Abstractions.dll
Provides methods allowing to cache authorizations after retrieving them from the store.
public interface IOpenIddictAuthorizationCache<TAuthorization> where TAuthorization : class
Type Parameters
TAuthorizationThe type of the Authorization entity.
Methods
AddAsync(TAuthorization, CancellationToken)
Add the specified authorization to the cache.
ValueTask AddAsync(TAuthorization authorization, CancellationToken cancellationToken)
Parameters
authorizationTAuthorizationThe authorization to add to the cache.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
FindAsync(string, string, string, string, ImmutableArray<string>, CancellationToken)
Retrieves the authorizations matching the specified parameters.
IAsyncEnumerable<TAuthorization> FindAsync(string subject, string client, string status, string type, ImmutableArray<string> scopes, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the authorization.
clientstringThe client associated with the authorization.
statusstringThe authorization status.
typestringThe authorization type.
scopesImmutableArray<string>The minimal scopes associated with the authorization.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TAuthorization>
The authorizations corresponding to the criteria.
FindAsync(string, string, string, string, CancellationToken)
Retrieves the authorizations matching the specified parameters.
IAsyncEnumerable<TAuthorization> FindAsync(string subject, string client, string status, string type, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the authorization.
clientstringThe client associated with the authorization.
statusstringThe authorization status.
typestringThe authorization type.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TAuthorization>
The authorizations corresponding to the criteria.
FindAsync(string, string, string, CancellationToken)
Retrieves the authorizations matching the specified parameters.
IAsyncEnumerable<TAuthorization> FindAsync(string subject, string client, string status, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the authorization.
clientstringThe client associated with the authorization.
statusstringThe authorization status.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TAuthorization>
The authorizations corresponding to the criteria.
FindAsync(string, string, CancellationToken)
Retrieves the authorizations corresponding to the specified subject and associated with the application identifier.
IAsyncEnumerable<TAuthorization> FindAsync(string subject, string client, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the authorization.
clientstringThe client associated with the authorization.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TAuthorization>
The authorizations corresponding to the subject/client.
FindByApplicationIdAsync(string, CancellationToken)
Retrieves the list of authorizations corresponding to the specified application identifier.
IAsyncEnumerable<TAuthorization> FindByApplicationIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifierstringThe application identifier associated with the authorizations.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TAuthorization>
The authorizations corresponding to the specified application.
FindByIdAsync(string, CancellationToken)
Retrieves an authorization using its unique identifier.
ValueTask<TAuthorization?> FindByIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifierstringThe unique identifier associated with the authorization.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TAuthorization>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the authorization corresponding to the identifier.
FindBySubjectAsync(string, CancellationToken)
Retrieves all the authorizations corresponding to the specified subject.
IAsyncEnumerable<TAuthorization> FindBySubjectAsync(string subject, CancellationToken cancellationToken)
Parameters
subjectstringThe subject associated with the authorization.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TAuthorization>
The authorizations corresponding to the specified subject.
RemoveAsync(TAuthorization, CancellationToken)
Removes the specified authorization from the cache.
ValueTask RemoveAsync(TAuthorization authorization, CancellationToken cancellationToken)
Parameters
authorizationTAuthorizationThe authorization to remove from the cache.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.