Class OpenIddictApplicationManager<TApplication>
Provides methods allowing to manage the applications stored in the store.
Inheritance
Namespace: OpenIddict.Core
Assembly: cs.temp.dll.dll
Syntax
public class OpenIddictApplicationManager<TApplication> : IOpenIddictApplicationManager where TApplication : class
Type Parameters
Name | Description |
---|---|
TApplication | The type of the Application entity. |
Remarks
Applications that do not want to depend on a specific entity type can use the non-generic
Constructors
OpenIddictApplicationManager(IOpenIddictApplicationCache<TApplication>, ILogger<OpenIddictApplicationManager<TApplication>>, IOptionsMonitor<OpenIddictCoreOptions>, IOpenIddictApplicationStoreResolver)
Declaration
public OpenIddictApplicationManager(IOpenIddictApplicationCache<TApplication> cache, ILogger<OpenIddictApplicationManager<TApplication>> logger, IOptionsMonitor<OpenIddictCoreOptions> options, IOpenIddictApplicationStoreResolver resolver)
Parameters
Type | Name | Description |
---|---|---|
IOpenIddictApplicationCache<TApplication> | cache | |
ILogger<OpenIddictApplicationManager<TApplication>> | logger | |
IOptionsMonitor<OpenIddictCoreOptions> | options | |
IOpenIddictApplicationStoreResolver | resolver |
Properties
Cache
Gets the cache associated with the current manager.
Declaration
protected IOpenIddictApplicationCache<TApplication> Cache { get; }
Property Value
Type | Description |
---|---|
IOpenIddictApplicationCache<TApplication> |
Logger
Gets the logger associated with the current manager.
Declaration
protected ILogger Logger { get; }
Property Value
Type | Description |
---|---|
ILogger |
Options
Gets the options associated with the current manager.
Declaration
protected IOptionsMonitor<OpenIddictCoreOptions> Options { get; }
Property Value
Type | Description |
---|---|
IOptionsMonitor<OpenIddictCoreOptions> |
Store
Gets the store associated with the current manager.
Declaration
protected IOpenIddictApplicationStore<TApplication> Store { get; }
Property Value
Type | Description |
---|---|
IOpenIddictApplicationStore<TApplication> |
Methods
CountAsync(CancellationToken)
Determines the number of applications that exist in the database.
Declaration
public virtual ValueTask<long> CountAsync(CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Int64> | A System.Threading.Tasks.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.
Declaration
public virtual ValueTask<long> CountAsync<TResult>(Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<IQueryable<TApplication>, IQueryable<TResult>> | query | The query to execute. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Int64> | A System.Threading.Tasks.ValueTask 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(TApplication, CancellationToken)
Creates a new application.
Declaration
public virtual ValueTask CreateAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application to create. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
CreateAsync(TApplication, 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
public virtual ValueTask CreateAsync(TApplication application, string secret, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application to create. |
System.String | secret | The client secret associated with the application, if applicable. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
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
public virtual ValueTask<TApplication> CreateAsync(OpenIddictApplicationDescriptor descriptor, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
OpenIddictApplicationDescriptor | descriptor | The application descriptor. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<TApplication> | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation, whose result returns the unique identifier associated with the application. |
DeleteAsync(TApplication, CancellationToken)
Removes an existing application.
Declaration
public virtual ValueTask DeleteAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application to delete. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
FindByClientIdAsync(String, CancellationToken)
Retrieves an application using its client identifier.
Declaration
public virtual ValueTask<TApplication> 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 |
---|---|
System.Threading.Tasks.ValueTask<TApplication> | A System.Threading.Tasks.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.
Declaration
public virtual ValueTask<TApplication> 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 |
---|---|
System.Threading.Tasks.ValueTask<TApplication> | A System.Threading.Tasks.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.
Declaration
public virtual IAsyncEnumerable<TApplication> 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 |
---|---|
System.Collections.Generic.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.
Declaration
public virtual IAsyncEnumerable<TApplication> 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 |
---|---|
System.Collections.Generic.IAsyncEnumerable<TApplication> | The client applications corresponding to the specified redirect_uri. |
GetAsync<TResult>(Func<IQueryable<TApplication>, IQueryable<TResult>>, CancellationToken)
Executes the specified query and returns the first element.
Declaration
public virtual ValueTask<TResult> GetAsync<TResult>(Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<IQueryable<TApplication>, IQueryable<TResult>> | query | The query to execute. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<TResult> | A System.Threading.Tasks.ValueTask 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<TApplication>, TState, IQueryable<TResult>>, TState, CancellationToken)
Executes the specified query and returns the first element.
Declaration
public virtual ValueTask<TResult> GetAsync<TState, TResult>(Func<IQueryable<TApplication>, TState, IQueryable<TResult>> query, TState state, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<IQueryable<TApplication>, TState, IQueryable<TResult>> | query | The query to execute. |
TState | state | The optional state. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<TResult> | A System.Threading.Tasks.ValueTask 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(TApplication, CancellationToken)
Retrieves the client identifier associated with an application.
Declaration
public virtual ValueTask<string> GetClientIdAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.String> | A System.Threading.Tasks.ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the client identifier associated with the application. |
GetClientTypeAsync(TApplication, CancellationToken)
Retrieves the client type associated with an application.
Declaration
public virtual ValueTask<string> GetClientTypeAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.String> | A System.Threading.Tasks.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.
Declaration
public virtual ValueTask<string> GetConsentTypeAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.String> | A System.Threading.Tasks.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.
Declaration
public virtual ValueTask<string> GetDisplayNameAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.String> | A System.Threading.Tasks.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.
Declaration
public virtual ValueTask<ImmutableDictionary<CultureInfo, string>> GetDisplayNamesAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<ImmutableDictionary<CultureInfo, System.String>> | A System.Threading.Tasks.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.
Declaration
public virtual ValueTask<string> GetIdAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.String> | A System.Threading.Tasks.ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the unique identifier associated with the application. |
GetLocalizedDisplayNameAsync(TApplication, 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
public virtual ValueTask<string> GetLocalizedDisplayNameAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.String> | A System.Threading.Tasks.ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the matching localized display name associated with the application. |
GetLocalizedDisplayNameAsync(TApplication, 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
public virtual ValueTask<string> GetLocalizedDisplayNameAsync(TApplication application, CultureInfo culture, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CultureInfo | culture | The culture (typically |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.String> | A System.Threading.Tasks.ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns the matching localized display name associated with the application. |
GetPermissionsAsync(TApplication, CancellationToken)
Retrieves the permissions associated with an application.
Declaration
public virtual ValueTask<ImmutableArray<string>> GetPermissionsAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<ImmutableArray<System.String>> | A System.Threading.Tasks.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 logout callback addresses associated with an application.
Declaration
public virtual ValueTask<ImmutableArray<string>> GetPostLogoutRedirectUrisAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<ImmutableArray<System.String>> | A System.Threading.Tasks.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.
Declaration
public virtual ValueTask<ImmutableDictionary<string, JsonElement>> GetPropertiesAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<ImmutableDictionary<System.String, JsonElement>> | A System.Threading.Tasks.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 callback addresses associated with an application.
Declaration
public virtual ValueTask<ImmutableArray<string>> GetRedirectUrisAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<ImmutableArray<System.String>> | A System.Threading.Tasks.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.
Declaration
public virtual ValueTask<ImmutableArray<string>> GetRequirementsAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<ImmutableArray<System.String>> | A System.Threading.Tasks.ValueTask<TResult> that can be used to monitor the asynchronous operation, whose result returns all the requirements associated with the application. |
HasClientTypeAsync(TApplication, String, CancellationToken)
Determines whether a given application has the specified client type.
Declaration
public virtual ValueTask<bool> HasClientTypeAsync(TApplication application, string type, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
System.String | type | The expected client type. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Boolean> |
|
HasConsentTypeAsync(TApplication, String, CancellationToken)
Determines whether a given application has the specified consent type.
Declaration
public virtual ValueTask<bool> HasConsentTypeAsync(TApplication application, string type, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
System.String | type | The expected consent type. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Boolean> |
|
HasPermissionAsync(TApplication, String, CancellationToken)
Determines whether the specified permission has been granted to the application.
Declaration
public virtual ValueTask<bool> HasPermissionAsync(TApplication application, string permission, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
System.String | permission | The permission. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Boolean> |
|
HasRequirementAsync(TApplication, String, CancellationToken)
Determines whether the specified requirement has been enforced for the specified application.
Declaration
public virtual ValueTask<bool> HasRequirementAsync(TApplication application, string requirement, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
System.String | requirement | The requirement. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Boolean> |
|
ListAsync(Nullable<Int32>, Nullable<Int32>, CancellationToken)
Executes the specified query and returns all the corresponding elements.
Declaration
public virtual IAsyncEnumerable<TApplication> 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 |
---|---|
System.Collections.Generic.IAsyncEnumerable<TApplication> | All the elements returned when executing the specified query. |
ListAsync<TResult>(Func<IQueryable<TApplication>, IQueryable<TResult>>, CancellationToken)
Executes the specified query and returns all the corresponding elements.
Declaration
public virtual IAsyncEnumerable<TResult> ListAsync<TResult>(Func<IQueryable<TApplication>, IQueryable<TResult>> query, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<IQueryable<TApplication>, IQueryable<TResult>> | query | The query to execute. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerable<TResult> | All the elements returned when executing the specified query. |
Type Parameters
Name | Description |
---|---|
TResult | The result type. |
ListAsync<TState, TResult>(Func<IQueryable<TApplication>, TState, IQueryable<TResult>>, TState, CancellationToken)
Executes the specified query and returns all the corresponding elements.
Declaration
public virtual IAsyncEnumerable<TResult> ListAsync<TState, TResult>(Func<IQueryable<TApplication>, TState, IQueryable<TResult>> query, TState state, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.Func<IQueryable<TApplication>, TState, IQueryable<TResult>> | query | The query to execute. |
TState | state | The optional state. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerable<TResult> | All the elements returned when executing the specified query. |
Type Parameters
Name | Description |
---|---|
TState | The state type. |
TResult | The result type. |
ObfuscateClientSecretAsync(String, CancellationToken)
Obfuscates the specified client secret so it can be safely stored in a database. By default, this method returns a complex hashed representation computed using PBKDF2.
Declaration
protected virtual ValueTask<string> ObfuscateClientSecretAsync(string secret, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | secret | The client secret. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.String> | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
PopulateAsync(TApplication, OpenIddictApplicationDescriptor, CancellationToken)
Populates the application using the specified descriptor.
Declaration
public virtual ValueTask PopulateAsync(TApplication application, OpenIddictApplicationDescriptor descriptor, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
OpenIddictApplicationDescriptor | descriptor | The descriptor. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
PopulateAsync(OpenIddictApplicationDescriptor, TApplication, CancellationToken)
Populates the specified descriptor using the properties exposed by the application.
Declaration
public virtual ValueTask PopulateAsync(OpenIddictApplicationDescriptor descriptor, TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
OpenIddictApplicationDescriptor | descriptor | The descriptor. |
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
UpdateAsync(TApplication, CancellationToken)
Updates an existing application.
Declaration
public virtual ValueTask UpdateAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application to update. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
UpdateAsync(TApplication, OpenIddictApplicationDescriptor, CancellationToken)
Updates an existing application.
Declaration
public virtual ValueTask UpdateAsync(TApplication application, OpenIddictApplicationDescriptor descriptor, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application to update. |
OpenIddictApplicationDescriptor | descriptor | The descriptor used to update the application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
UpdateAsync(TApplication, 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
public virtual ValueTask UpdateAsync(TApplication application, string secret, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application to update. |
System.String | secret | The client secret associated with the application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
ValidateAsync(TApplication, CancellationToken)
Validates the application to ensure it's in a consistent state.
Declaration
public virtual IAsyncEnumerable<ValidationResult> ValidateAsync(TApplication application, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | application | The application. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Collections.Generic.IAsyncEnumerable<ValidationResult> | The validation error encountered when validating the application. |
ValidateClientSecretAsync(TApplication, String, CancellationToken)
Validates the client_secret associated with an application.
Declaration
public virtual ValueTask<bool> ValidateClientSecretAsync(TApplication application, string secret, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | 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 |
---|---|
System.Threading.Tasks.ValueTask<System.Boolean> | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation. |
ValidateClientSecretAsync(String, String, CancellationToken)
Validates the specified value to ensure it corresponds to the client secret. Note: when overriding this method, using a time-constant comparer is strongly recommended.
Declaration
protected virtual ValueTask<bool> ValidateClientSecretAsync(string secret, string comparand, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | secret | The client secret to compare to the value stored in the database. |
System.String | comparand | The value stored in the database, which is usually a hashed representation of the secret. |
CancellationToken | cancellationToken | The |
Returns
Type | Description |
---|---|
System.Threading.Tasks.ValueTask<System.Boolean> | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation, whose result returns a boolean indicating whether the specified value was valid. |
ValidateRedirectUriAsync(TApplication, String, CancellationToken)
Validates the redirect_uri to ensure it's associated with an application.
Declaration
public virtual ValueTask<bool> ValidateRedirectUriAsync(TApplication application, string address, CancellationToken cancellationToken = null)
Parameters
Type | Name | Description |
---|---|---|
TApplication | 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 |
---|---|
System.Threading.Tasks.ValueTask<System.Boolean> | A System.Threading.Tasks.ValueTask that can be used to monitor the asynchronous operation, whose result returns a boolean indicating whether the redirect_uri was valid. |