Show / Hide Table of Contents

# 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Int64> | A that can be used to monitor the asynchronous operation, whose result returns the number of applications in the database.

#### 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
--- | --- | ---
System.Func<IQueryable<System.Object>, IQueryable<TResult>> | query | The query to execute.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Int64> | A that can be used to monitor the asynchronous operation, whose result returns the number of applications that match the specified query.

##### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Object> | A that can be used to monitor the asynchronous operation, whose result returns the unique identifier associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Object> | A 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.

##### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Object> | A 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.

##### 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 that can be used to abort the operation.

##### 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 that can be used to abort the operation.

##### 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
--- | --- | ---
System.Func<IQueryable<System.Object>, IQueryable<TResult>> | query | The query to execute.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<TResult> | A that can be used to monitor the asynchronous operation, whose result returns the first element returned when executing the query.

##### 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
--- | --- | ---
System.Func<IQueryable<System.Object>, TState, IQueryable<TResult>> | query | The query to execute.
TState | state | The optional state.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<TResult> | A that can be used to monitor the asynchronous operation, whose result returns the first element returned when executing the query.

##### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.String> | A that can be used to monitor the asynchronous operation, whose result returns the client identifier associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.String> | A that can be used to monitor the asynchronous operation, whose result returns the client type of the application (by default, "public").

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.String> | A that can be used to monitor the asynchronous operation, whose result returns the consent type of the application (by default, "explicit").

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.String> | A that can be used to monitor the asynchronous operation, whose result returns the display name associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableDictionary<CultureInfo, System.String>> | A that can be used to monitor the asynchronous operation, whose result returns all the localized display names associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.String> | A that can be used to monitor the asynchronous operation, whose result returns the unique identifier associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.String> | A that can be used to monitor the asynchronous operation, whose result returns the matching localized display name associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.String> | A that can be used to monitor the asynchronous operation, whose result returns the matching localized display name associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableArray<System.String>> | A that can be used to monitor the asynchronous operation, whose result returns all the permissions associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableArray<System.String>> | A that can be used to monitor the asynchronous operation, whose result returns all the post_logout_redirect_uri associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableDictionary<System.String, JsonElement>> | A that can be used to monitor the asynchronous operation, whose result returns all the additional properties associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableArray<System.String>> | A that can be used to monitor the asynchronous operation, whose result returns all the redirect_uri associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<ImmutableArray<System.String>> | A that can be used to monitor the asynchronous operation, whose result returns all the requirements associated with the application.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Boolean> | `true` if the application has the specified client type, `false` otherwise.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Boolean> | `true` if the application has the specified consent type, `false` otherwise.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Boolean> | `true` if the application has been granted the specified permission, `false` otherwise.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Boolean> | `true` if the requirement has been enforced for the specified application, `false` otherwise.

#### 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 that can be used to abort the operation.

##### 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
--- | --- | ---
System.Func<IQueryable<System.Object>, IQueryable<TResult>> | query | The query to execute.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### 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
--- | --- | ---
System.Func<IQueryable<System.Object>, TState, IQueryable<TResult>> | query | The query to execute.
TState | state | The optional state.
CancellationToken | cancellationToken | The that can be used to abort the operation.

##### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Boolean> | A that can be used to monitor the asynchronous operation.

#### 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 that can be used to abort the operation.

##### Returns

Type | Description
--- | ---
ValueTask<System.Boolean> | A that can be used to monitor the asynchronous operation, whose result returns a boolean indicating whether the redirect_uri was valid.