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
TApplication
The type of the Application entity.
Methods
CountAsync(CancellationToken)
Determines the number of applications that exist in the database.
ValueTask<long> CountAsync(CancellationToken cancellationToken)
Parameters
cancellationToken
CancellationTokenThe 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
query
Func<IQueryable<TApplication>, IQueryable<TResult>>The query to execute.
cancellationToken
CancellationTokenThe 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
TResult
The result type.
CreateAsync(TApplication, CancellationToken)
Creates a new application.
ValueTask CreateAsync(TApplication application, CancellationToken cancellationToken)
Parameters
application
TApplicationThe application to create.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
DeleteAsync(TApplication, CancellationToken)
Removes an existing application.
ValueTask DeleteAsync(TApplication application, CancellationToken cancellationToken)
Parameters
application
TApplicationThe application to delete.
cancellationToken
CancellationTokenThe 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
identifier
stringThe client identifier associated with the application.
cancellationToken
CancellationTokenThe 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
identifier
stringThe unique identifier associated with the application.
cancellationToken
CancellationTokenThe 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
uri
stringThe post_logout_redirect_uri associated with the applications.
cancellationToken
CancellationTokenThe 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
uri
stringThe redirect_uri associated with the applications.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
query
Func<IQueryable<TApplication>, TState, IQueryable<TResult>>The query to execute.
state
TStateThe optional state.
cancellationToken
CancellationTokenThe 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
TState
The state type.
TResult
The result type.
GetClientIdAsync(TApplication, CancellationToken)
Retrieves the client identifier associated with an application.
ValueTask<string?> GetClientIdAsync(TApplication application, CancellationToken cancellationToken)
Parameters
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
cancellationToken
CancellationTokenThe 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
cancellationToken
CancellationTokenThe 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
count
int?The number of results to return.
offset
int?The number of results to skip.
cancellationToken
CancellationTokenThe 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
query
Func<IQueryable<TApplication>, TState, IQueryable<TResult>>The query to execute.
state
TStateThe optional state.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
- IAsyncEnumerable<TResult>
All the elements returned when executing the specified query.
Type Parameters
TState
The state type.
TResult
The result type.
SetApplicationTypeAsync(TApplication, string?, CancellationToken)
Sets the application type associated with an application.
ValueTask SetApplicationTypeAsync(TApplication application, string? type, CancellationToken cancellationToken)
Parameters
application
TApplicationThe application.
type
stringThe application type associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
identifier
stringThe client identifier associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
secret
stringThe client secret associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
type
stringThe client type associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
type
stringThe consent type associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
name
stringThe display name associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
names
ImmutableDictionary<CultureInfo, string>The localized display names associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
set
JsonWebKeySetThe JSON Web Key Set associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
permissions
ImmutableArray<string>The permissions associated with the application
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
uris
ImmutableArray<string>The post-logout redirect URIs associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
properties
ImmutableDictionary<string, JsonElement>The additional properties associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
uris
ImmutableArray<string>The redirect URIs associated with the application.
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
requirements
ImmutableArray<string>The requirements associated with the application
cancellationToken
CancellationTokenThe 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
application
TApplicationThe application.
settings
ImmutableDictionary<string, string>The settings associated with the application.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.
Returns
UpdateAsync(TApplication, CancellationToken)
Updates an existing application.
ValueTask UpdateAsync(TApplication application, CancellationToken cancellationToken)
Parameters
application
TApplicationThe application to update.
cancellationToken
CancellationTokenThe CancellationToken that can be used to abort the operation.