Table of Contents

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 TAuthorization

The authorization to add to the cache.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask

A ValueTask that can be used to monitor the asynchronous operation.

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 string

The subject associated with the authorization.

client string

The client associated with the authorization.

status string

The authorization status.

type string

The authorization type.

scopes ImmutableArray<string>

The minimal scopes associated with the authorization.

cancellationToken CancellationToken

The 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 string

The subject associated with the authorization.

client string

The client associated with the authorization.

status string

The authorization status.

type string

The authorization type.

cancellationToken CancellationToken

The 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 string

The subject associated with the authorization.

client string

The client associated with the authorization.

status string

The authorization status.

cancellationToken CancellationToken

The 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 string

The subject associated with the authorization.

client string

The client associated with the authorization.

cancellationToken CancellationToken

The 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 string

The application identifier associated with the authorizations.

cancellationToken CancellationToken

The 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 string

The unique identifier associated with the authorization.

cancellationToken CancellationToken

The 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 string

The subject associated with the authorization.

cancellationToken CancellationToken

The 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 TAuthorization

The authorization to remove from the cache.

cancellationToken CancellationToken

The CancellationToken that can be used to abort the operation.

Returns

ValueTask

A ValueTask that can be used to monitor the asynchronous operation.