Interface IOpenIddictApplicationStore<TApplication>
- Namespace
- OpenIddict.Abstractions
- Assembly
- OpenIddict.Abstractions.dll
Provides methods allowing to manage the applications stored in a database.
public interface IOpenIddictApplicationStore<TApplication> where TApplication : class
Type Parameters
TApplicationThe type of the Application entity.
Methods
CountAsync(CancellationToken)
Determines the number of applications that exist in the database.
ValueTask<long> CountAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<long>
A ValueTask that can be used to monitor the asynchronous operation, whose result returns the number of applications in the database.
CountAsync<TResult>(Func<IQueryable<TApplication>, IQueryable<TResult>>, CancellationToken)
Determines the number of applications that match the specified query.
ValueTask<long> CountAsync<TResult>(Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken)
Parameters
queryFunc<IQueryable<TApplication>, IQueryable<TResult>>The query to execute.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<long>
A ValueTask that can be used to monitor the asynchronous operation, whose result returns the number of applications that match the specified query.
Type Parameters
TResultThe result type.
CreateAsync(TApplication, CancellationToken)
Creates a new application.
ValueTask CreateAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application to create.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
DeleteAsync(TApplication, CancellationToken)
Removes an existing application.
ValueTask DeleteAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application to delete.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
FindByClientIdAsync(string, CancellationToken)
Retrieves an application using its client identifier.
ValueTask<TApplication?> FindByClientIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifierstringThe client identifier associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TApplication>
A ValueTask that can be used to monitor the asynchronous operation, whose result returns the client application corresponding to the identifier.
FindByIdAsync(string, CancellationToken)
Retrieves an application using its unique identifier.
ValueTask<TApplication?> FindByIdAsync(string identifier, CancellationToken cancellationToken)
Parameters
identifierstringThe unique identifier associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TApplication>
A ValueTask that can be used to monitor the asynchronous operation, whose result returns the client application corresponding to the identifier.
FindByPostLogoutRedirectUriAsync(string, CancellationToken)
Retrieves all the applications associated with the specified post_logout_redirect_uri.
IAsyncEnumerable<TApplication> FindByPostLogoutRedirectUriAsync(string uri, CancellationToken cancellationToken)
Parameters
uristringThe post_logout_redirect_uri associated with the applications.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TApplication>
The client applications corresponding to the specified post_logout_redirect_uri.
FindByRedirectUriAsync(string, CancellationToken)
Retrieves all the applications associated with the specified redirect_uri.
IAsyncEnumerable<TApplication> FindByRedirectUriAsync(string uri, CancellationToken cancellationToken)
Parameters
uristringThe redirect_uri associated with the applications.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TApplication>
The client applications corresponding to the specified redirect_uri.
GetApplicationTypeAsync(TApplication, CancellationToken)
Retrieves the application type associated with an application.
ValueTask<string?> GetApplicationTypeAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<string>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the application type of the application (by default, "web").
GetAsync<TState, TResult>(Func<IQueryable<TApplication>, TState, IQueryable<TResult>>, TState, CancellationToken)
Executes the specified query and returns the first element.
ValueTask<TResult?> GetAsync<TState, TResult>(Func<IQueryable<TApplication>, TState, IQueryable<TResult>> query, TState state, CancellationToken cancellationToken)
Parameters
queryFunc<IQueryable<TApplication>, TState, IQueryable<TResult>>The query to execute.
stateTStateThe optional state.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TResult>
A ValueTask that can be used to monitor the asynchronous operation, whose result returns the first element returned when executing the query.
Type Parameters
TStateThe state type.
TResultThe result type.
GetClientIdAsync(TApplication, CancellationToken)
Retrieves the client identifier associated with an application.
ValueTask<string?> GetClientIdAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<string>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the client identifier associated with the application.
GetClientSecretAsync(TApplication, CancellationToken)
Retrieves the client secret associated with an application. Note: depending on the manager used to create the application, the client secret may be hashed for security reasons.
ValueTask<string?> GetClientSecretAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<string>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the client secret associated with the application.
GetClientTypeAsync(TApplication, CancellationToken)
Retrieves the client type associated with an application.
ValueTask<string?> GetClientTypeAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<string>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the client type of the application (by default, "public").
GetConsentTypeAsync(TApplication, CancellationToken)
Retrieves the consent type associated with an application.
ValueTask<string?> GetConsentTypeAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<string>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the consent type of the application (by default, "explicit").
GetDisplayNameAsync(TApplication, CancellationToken)
Retrieves the display name associated with an application.
ValueTask<string?> GetDisplayNameAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<string>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the display name associated with the application.
GetDisplayNamesAsync(TApplication, CancellationToken)
Retrieves the localized display names associated with an application.
ValueTask<ImmutableDictionary<CultureInfo, string>> GetDisplayNamesAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<ImmutableDictionary<CultureInfo, string>>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the localized display names associated with the application.
GetIdAsync(TApplication, CancellationToken)
Retrieves the unique identifier associated with an application.
ValueTask<string?> GetIdAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<string>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the unique identifier associated with the application.
GetJsonWebKeySetAsync(TApplication, CancellationToken)
Retrieves the JSON Web Key Set associated with an application.
ValueTask<JsonWebKeySet?> GetJsonWebKeySetAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<JsonWebKeySet>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the JSON Web Key Set associated with the application.
GetPermissionsAsync(TApplication, CancellationToken)
Retrieves the permissions associated with an application.
ValueTask<ImmutableArray<string>> GetPermissionsAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<ImmutableArray<string>>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the permissions associated with the application.
GetPostLogoutRedirectUrisAsync(TApplication, CancellationToken)
Retrieves the post-logout redirect URIs associated with an application.
ValueTask<ImmutableArray<string>> GetPostLogoutRedirectUrisAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<ImmutableArray<string>>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the post_logout_redirect_uri associated with the application.
GetPropertiesAsync(TApplication, CancellationToken)
Retrieves the additional properties associated with an application.
ValueTask<ImmutableDictionary<string, JsonElement>> GetPropertiesAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<ImmutableDictionary<string, JsonElement>>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the additional properties associated with the application.
GetRedirectUrisAsync(TApplication, CancellationToken)
Retrieves the redirect URIs associated with an application.
ValueTask<ImmutableArray<string>> GetRedirectUrisAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<ImmutableArray<string>>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the redirect_uri associated with the application.
GetRequirementsAsync(TApplication, CancellationToken)
Retrieves the requirements associated with an application.
ValueTask<ImmutableArray<string>> GetRequirementsAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<ImmutableArray<string>>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the requirements associated with the application.
GetSettingsAsync(TApplication, CancellationToken)
Retrieves the settings associated with an application.
ValueTask<ImmutableDictionary<string, string>> GetSettingsAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<ImmutableDictionary<string, string>>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the settings associated with the application.
InstantiateAsync(CancellationToken)
Instantiates a new application.
ValueTask<TApplication> InstantiateAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- ValueTask<TApplication>
A ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the instantiated application, that can be persisted in the database.
ListAsync(int?, int?, CancellationToken)
Executes the specified query and returns all the corresponding elements.
IAsyncEnumerable<TApplication> ListAsync(int? count, int? offset, CancellationToken cancellationToken)
Parameters
countint?The number of results to return.
offsetint?The number of results to skip.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TApplication>
All the elements returned when executing the specified query.
ListAsync<TState, TResult>(Func<IQueryable<TApplication>, TState, IQueryable<TResult>>, TState, CancellationToken)
Executes the specified query and returns all the corresponding elements.
IAsyncEnumerable<TResult> ListAsync<TState, TResult>(Func<IQueryable<TApplication>, TState, IQueryable<TResult>> query, TState state, CancellationToken cancellationToken)
Parameters
queryFunc<IQueryable<TApplication>, TState, IQueryable<TResult>>The query to execute.
stateTStateThe optional state.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TResult>
All the elements returned when executing the specified query.
Type Parameters
TStateThe state type.
TResultThe result type.
SetApplicationTypeAsync(TApplication, string?, CancellationToken)
Sets the application type associated with an application.
ValueTask SetApplicationTypeAsync(TApplication application, string? type, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
typestringThe application type associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetClientIdAsync(TApplication, string?, CancellationToken)
Sets the client identifier associated with an application.
ValueTask SetClientIdAsync(TApplication application, string? identifier, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
identifierstringThe client identifier associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetClientSecretAsync(TApplication, string?, CancellationToken)
Sets the client secret associated with an application. Note: depending on the manager used to create the application, the client secret may be hashed for security reasons.
ValueTask SetClientSecretAsync(TApplication application, string? secret, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
secretstringThe client secret associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetClientTypeAsync(TApplication, string?, CancellationToken)
Sets the client type associated with an application.
ValueTask SetClientTypeAsync(TApplication application, string? type, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
typestringThe client type associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetConsentTypeAsync(TApplication, string?, CancellationToken)
Sets the consent type associated with an application.
ValueTask SetConsentTypeAsync(TApplication application, string? type, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
typestringThe consent type associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetDisplayNameAsync(TApplication, string?, CancellationToken)
Sets the display name associated with an application.
ValueTask SetDisplayNameAsync(TApplication application, string? name, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
namestringThe display name associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetDisplayNamesAsync(TApplication, ImmutableDictionary<CultureInfo, string>, CancellationToken)
Sets the localized display names associated with an application.
ValueTask SetDisplayNamesAsync(TApplication application, ImmutableDictionary<CultureInfo, string> names, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
namesImmutableDictionary<CultureInfo, string>The localized display names associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetJsonWebKeySetAsync(TApplication, JsonWebKeySet?, CancellationToken)
Sets the JSON Web Key Set associated with an application.
ValueTask SetJsonWebKeySetAsync(TApplication application, JsonWebKeySet? set, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
setJsonWebKeySetThe JSON Web Key Set associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetPermissionsAsync(TApplication, ImmutableArray<string>, CancellationToken)
Sets the permissions associated with an application.
ValueTask SetPermissionsAsync(TApplication application, ImmutableArray<string> permissions, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
permissionsImmutableArray<string>The permissions associated with the application
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetPostLogoutRedirectUrisAsync(TApplication, ImmutableArray<string>, CancellationToken)
Sets the post-logout redirect URIs associated with an application.
ValueTask SetPostLogoutRedirectUrisAsync(TApplication application, ImmutableArray<string> uris, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
urisImmutableArray<string>The post-logout redirect URIs associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetPropertiesAsync(TApplication, ImmutableDictionary<string, JsonElement>, CancellationToken)
Sets the additional properties associated with an application.
ValueTask SetPropertiesAsync(TApplication application, ImmutableDictionary<string, JsonElement> properties, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
propertiesImmutableDictionary<string, JsonElement>The additional properties associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetRedirectUrisAsync(TApplication, ImmutableArray<string>, CancellationToken)
Sets the redirect URIs associated with an application.
ValueTask SetRedirectUrisAsync(TApplication application, ImmutableArray<string> uris, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
urisImmutableArray<string>The redirect URIs associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetRequirementsAsync(TApplication, ImmutableArray<string>, CancellationToken)
Sets the requirements associated with an application.
ValueTask SetRequirementsAsync(TApplication application, ImmutableArray<string> requirements, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
requirementsImmutableArray<string>The requirements associated with the application
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
SetSettingsAsync(TApplication, ImmutableDictionary<string, string>, CancellationToken)
Sets the settings associated with an application.
ValueTask SetSettingsAsync(TApplication application, ImmutableDictionary<string, string> settings, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application.
settingsImmutableDictionary<string, string>The settings associated with the application.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
UpdateAsync(TApplication, CancellationToken)
Updates an existing application.
ValueTask UpdateAsync(TApplication application, CancellationToken cancellationToken)
Parameters
applicationTApplicationThe application to update.
cancellationTokenCancellationTokenThe CancellationToken that can be used to abort the operation.