Interface IOpenIddictApplicationManager
Provides methods allowing to manage the applications stored in the store. Note: this interface is not meant to be implemented by custom managers, that should inherit from the generic OpenIddictApplicationManager class. It is primarily intended to be used by services that cannot easily depend on the generic application manager. The actual application entity type is automatically determined at runtime based on the OpenIddict core options.
Namespace: OpenIddict.Abstractions
Assembly: cs.temp.dll.dll
Syntax
public interface IOpenIddictApplicationManager
Methods
CountAsync(CancellationToken)
Determines the number of applications that exist in the database.
Declaration
ValueTask<long> CountAsync(CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Int64> | A |
CountAsync<TResult>(Func<IQueryable<Object>, IQueryable<TResult>>, CancellationToken)
Determines the number of applications that match the specified query.
Declaration
ValueTask<long> CountAsync<TResult>(Func<IQueryable<object>, IQueryable<TResult>> query, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IQueryable<System.Object>, IQueryable<TResult>> | query | The query to execute. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Int64> | A |
Type Parameters
| Name | Description |
|---|---|
| TResult | The result type. |
CreateAsync(OpenIddictApplicationDescriptor, CancellationToken)
Creates a new application based on the specified descriptor. Note: the default implementation automatically hashes the client secret before storing it in the database, for security reasons.
Declaration
ValueTask<object> CreateAsync(OpenIddictApplicationDescriptor descriptor, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| OpenIddictApplicationDescriptor | descriptor | The application descriptor. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Object> | A |
CreateAsync(Object, CancellationToken)
Creates a new application.
Declaration
ValueTask CreateAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application to create. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask | A |
CreateAsync(Object, String, CancellationToken)
Creates a new application. Note: the default implementation automatically hashes the client secret before storing it in the database, for security reasons.
Declaration
ValueTask CreateAsync(object application, string secret, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application to create. |
| System.String | secret | The client secret associated with the application, if applicable. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask | A |
DeleteAsync(Object, CancellationToken)
Removes an existing application.
Declaration
ValueTask DeleteAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application to delete. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask | A |
FindByClientIdAsync(String, CancellationToken)
Retrieves an application using its client identifier.
Declaration
ValueTask<object> FindByClientIdAsync(string identifier, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | identifier | The client identifier associated with the application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Object> | A |
FindByIdAsync(String, CancellationToken)
Retrieves an application using its unique identifier.
Declaration
ValueTask<object> FindByIdAsync(string identifier, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | identifier | The unique identifier associated with the application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Object> | A |
FindByPostLogoutRedirectUriAsync(String, CancellationToken)
Retrieves all the applications associated with the specified post_logout_redirect_uri.
Declaration
IAsyncEnumerable<object> FindByPostLogoutRedirectUriAsync(string address, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | address | The post_logout_redirect_uri associated with the applications. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<System.Object> | The client applications corresponding to the specified post_logout_redirect_uri. |
FindByRedirectUriAsync(String, CancellationToken)
Retrieves all the applications associated with the specified redirect_uri.
Declaration
IAsyncEnumerable<object> FindByRedirectUriAsync(string address, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | address | The redirect_uri associated with the applications. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<System.Object> | The client applications corresponding to the specified redirect_uri. |
GetAsync<TResult>(Func<IQueryable<Object>, IQueryable<TResult>>, CancellationToken)
Executes the specified query and returns the first element.
Declaration
ValueTask<TResult> GetAsync<TResult>(Func<IQueryable<object>, IQueryable<TResult>> query, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IQueryable<System.Object>, IQueryable<TResult>> | query | The query to execute. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<TResult> | A |
Type Parameters
| Name | Description |
|---|---|
| TResult | The result type. |
GetAsync<TState, TResult>(Func<IQueryable<Object>, TState, IQueryable<TResult>>, TState, CancellationToken)
Executes the specified query and returns the first element.
Declaration
ValueTask<TResult> GetAsync<TState, TResult>(Func<IQueryable<object>, TState, IQueryable<TResult>> query, TState state, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IQueryable<System.Object>, TState, IQueryable<TResult>> | query | The query to execute. |
| TState | state | The optional state. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<TResult> | A |
Type Parameters
| Name | Description |
|---|---|
| TState | The state type. |
| TResult | The result type. |
GetClientIdAsync(Object, CancellationToken)
Retrieves the client identifier associated with an application.
Declaration
ValueTask<string> GetClientIdAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.String> | A |
GetClientTypeAsync(Object, CancellationToken)
Retrieves the client type associated with an application.
Declaration
ValueTask<string> GetClientTypeAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.String> | A |
GetConsentTypeAsync(Object, CancellationToken)
Retrieves the consent type associated with an application.
Declaration
ValueTask<string> GetConsentTypeAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.String> | A |
GetDisplayNameAsync(Object, CancellationToken)
Retrieves the display name associated with an application.
Declaration
ValueTask<string> GetDisplayNameAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.String> | A |
GetDisplayNamesAsync(Object, CancellationToken)
Retrieves the localized display names associated with an application.
Declaration
ValueTask<ImmutableDictionary<CultureInfo, string>> GetDisplayNamesAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<ImmutableDictionary<CultureInfo, System.String>> | A |
GetIdAsync(Object, CancellationToken)
Retrieves the unique identifier associated with an application.
Declaration
ValueTask<string> GetIdAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.String> | A |
GetLocalizedDisplayNameAsync(Object, CancellationToken)
Retrieves the localized display name associated with an application and corresponding to the current UI culture or one of its parents. If no matching value can be found, the non-localized value is returned.
Declaration
ValueTask<string> GetLocalizedDisplayNameAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.String> | A |
GetLocalizedDisplayNameAsync(Object, CultureInfo, CancellationToken)
Retrieves the localized display name associated with an application and corresponding to the specified culture or one of its parents. If no matching value can be found, the non-localized value is returned.
Declaration
ValueTask<string> GetLocalizedDisplayNameAsync(object application, CultureInfo culture, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CultureInfo | culture | The culture (typically |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.String> | A |
GetPermissionsAsync(Object, CancellationToken)
Retrieves the permissions associated with an application.
Declaration
ValueTask<ImmutableArray<string>> GetPermissionsAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<ImmutableArray<System.String>> | A |
GetPostLogoutRedirectUrisAsync(Object, CancellationToken)
Retrieves the logout callback addresses associated with an application.
Declaration
ValueTask<ImmutableArray<string>> GetPostLogoutRedirectUrisAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<ImmutableArray<System.String>> | A |
GetPropertiesAsync(Object, CancellationToken)
Retrieves the additional properties associated with an application.
Declaration
ValueTask<ImmutableDictionary<string, JsonElement>> GetPropertiesAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<ImmutableDictionary<System.String, JsonElement>> | A |
GetRedirectUrisAsync(Object, CancellationToken)
Retrieves the callback addresses associated with an application.
Declaration
ValueTask<ImmutableArray<string>> GetRedirectUrisAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<ImmutableArray<System.String>> | A |
GetRequirementsAsync(Object, CancellationToken)
Retrieves the requirements associated with an application.
Declaration
ValueTask<ImmutableArray<string>> GetRequirementsAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<ImmutableArray<System.String>> | A |
HasClientTypeAsync(Object, String, CancellationToken)
Determines whether a given application has the specified client type.
Declaration
ValueTask<bool> HasClientTypeAsync(object application, string type, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| System.String | type | The expected client type. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Boolean> |
|
HasConsentTypeAsync(Object, String, CancellationToken)
Determines whether a given application has the specified consent type.
Declaration
ValueTask<bool> HasConsentTypeAsync(object application, string type, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| System.String | type | The expected consent type. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Boolean> |
|
HasPermissionAsync(Object, String, CancellationToken)
Determines whether the specified permission has been granted to the application.
Declaration
ValueTask<bool> HasPermissionAsync(object application, string permission, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| System.String | permission | The permission. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Boolean> |
|
HasRequirementAsync(Object, String, CancellationToken)
Determines whether the specified requirement has been enforced for the specified application.
Declaration
ValueTask<bool> HasRequirementAsync(object application, string requirement, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| System.String | requirement | The requirement. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Boolean> |
|
ListAsync(Nullable<Int32>, Nullable<Int32>, CancellationToken)
Executes the specified query and returns all the corresponding elements.
Declaration
IAsyncEnumerable<object> ListAsync(int? count = default(int? ), int? offset = default(int? ), CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Nullable<System.Int32> | count | The number of results to return. |
| System.Nullable<System.Int32> | offset | The number of results to skip. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<System.Object> | All the elements returned when executing the specified query. |
ListAsync<TResult>(Func<IQueryable<Object>, IQueryable<TResult>>, CancellationToken)
Executes the specified query and returns all the corresponding elements.
Declaration
IAsyncEnumerable<TResult> ListAsync<TResult>(Func<IQueryable<object>, IQueryable<TResult>> query, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IQueryable<System.Object>, IQueryable<TResult>> | query | The query to execute. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<TResult> | All the elements returned when executing the specified query. |
Type Parameters
| Name | Description |
|---|---|
| TResult | The result type. |
ListAsync<TState, TResult>(Func<IQueryable<Object>, TState, IQueryable<TResult>>, TState, CancellationToken)
Executes the specified query and returns all the corresponding elements.
Declaration
IAsyncEnumerable<TResult> ListAsync<TState, TResult>(Func<IQueryable<object>, TState, IQueryable<TResult>> query, TState state, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<IQueryable<System.Object>, TState, IQueryable<TResult>> | query | The query to execute. |
| TState | state | The optional state. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<TResult> | All the elements returned when executing the specified query. |
Type Parameters
| Name | Description |
|---|---|
| TState | The state type. |
| TResult | The result type. |
PopulateAsync(OpenIddictApplicationDescriptor, Object, CancellationToken)
Populates the specified descriptor using the properties exposed by the application.
Declaration
ValueTask PopulateAsync(OpenIddictApplicationDescriptor descriptor, object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| OpenIddictApplicationDescriptor | descriptor | The descriptor. |
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask | A |
PopulateAsync(Object, OpenIddictApplicationDescriptor, CancellationToken)
Populates the application using the specified descriptor.
Declaration
ValueTask PopulateAsync(object application, OpenIddictApplicationDescriptor descriptor, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| OpenIddictApplicationDescriptor | descriptor | The descriptor. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask | A |
UpdateAsync(Object, CancellationToken)
Updates an existing application.
Declaration
ValueTask UpdateAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application to update. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask | A |
UpdateAsync(Object, OpenIddictApplicationDescriptor, CancellationToken)
Updates an existing application.
Declaration
ValueTask UpdateAsync(object application, OpenIddictApplicationDescriptor descriptor, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application to update. |
| OpenIddictApplicationDescriptor | descriptor | The descriptor used to update the application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask | A |
UpdateAsync(Object, String, CancellationToken)
Updates an existing application and replaces the existing secret. Note: the default implementation automatically hashes the client secret before storing it in the database, for security reasons.
Declaration
ValueTask UpdateAsync(object application, string secret, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application to update. |
| System.String | secret | The client secret associated with the application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask | A |
ValidateAsync(Object, CancellationToken)
Validates the application to ensure it's in a consistent state.
Declaration
IAsyncEnumerable<ValidationResult> ValidateAsync(object application, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| IAsyncEnumerable<ValidationResult> | The validation error encountered when validating the application. |
ValidateClientSecretAsync(Object, String, CancellationToken)
Validates the client_secret associated with an application.
Declaration
ValueTask<bool> ValidateClientSecretAsync(object application, string secret, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| System.String | secret | The secret that should be compared to the client_secret stored in the database. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Boolean> | A |
ValidateRedirectUriAsync(Object, String, CancellationToken)
Validates the redirect_uri to ensure it's associated with an application.
Declaration
ValueTask<bool> ValidateRedirectUriAsync(object application, string address, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | application | The application. |
| System.String | address | The address that should be compared to one of the redirect_uri stored in the database. |
| CancellationToken | cancellationToken | The |
Returns
| Type | Description |
|---|---|
| ValueTask<System.Boolean> | A |