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
TAuthorization
The type of the Authorization entity.
Methods
AddAsync(TAuthorization, CancellationToken)
Add the specified authorization to the cache.
ValueTask AddAsync(TAuthorization authorization, CancellationToken cancellationToken)
Parameters
authorization
TAuthorizationThe authorization to add to the cache.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the authorization.
client
stringThe client associated with the authorization.
status
stringThe authorization status.
type
stringThe authorization type.
scopes
ImmutableArray<string>The minimal scopes associated with the authorization.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the authorization.
client
stringThe client associated with the authorization.
status
stringThe authorization status.
type
stringThe authorization type.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the authorization.
client
stringThe client associated with the authorization.
status
stringThe authorization status.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the authorization.
client
stringThe client associated with the authorization.
cancellationToken
CancellationTokenThe 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
identifier
stringThe application identifier associated with the authorizations.
cancellationToken
CancellationTokenThe 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
identifier
stringThe unique identifier associated with the authorization.
cancellationToken
CancellationTokenThe 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
subject
stringThe subject associated with the authorization.
cancellationToken
CancellationTokenThe 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
authorization
TAuthorizationThe authorization to remove from the cache.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.