Class OpenIddictServerDataProtectionBuilder
Exposes the necessary methods required to configure the OpenIddict ASP.NET Core Data Protection integration.
Inheritance
Inherited Members
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: cs.temp.dll.dll
Syntax
public class OpenIddictServerDataProtectionBuilder
Constructors
OpenIddictServerDataProtectionBuilder(IServiceCollection)
Initializes a new instance of OpenIddictServerDataProtectionBuilder.
Declaration
public OpenIddictServerDataProtectionBuilder(IServiceCollection services)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services | The services collection. |
Methods
Configure(Action<OpenIddictServerDataProtectionOptions>)
Amends the default OpenIddict server ASP.NET Core Data Protection configuration.
Declaration
public OpenIddictServerDataProtectionBuilder Configure(Action<OpenIddictServerDataProtectionOptions> configuration)
Parameters
Type | Name | Description |
---|---|---|
System.Action<OpenIddictServerDataProtectionOptions> | configuration | The delegate used to configure the OpenIddict options. |
Returns
Type | Description |
---|---|
OpenIddictServerDataProtectionBuilder |
Remarks
This extension can be safely called multiple times.
PreferDefaultAccessTokenFormat()
Configures OpenIddict to use the default token format (JWT) when issuing new access tokens.
Declaration
public OpenIddictServerDataProtectionBuilder PreferDefaultAccessTokenFormat()
Returns
Type | Description |
---|---|
OpenIddictServerDataProtectionBuilder |
PreferDefaultAuthorizationCodeFormat()
Configures OpenIddict to use the default token format (JWT) when issuing new authorization codes.
Declaration
public OpenIddictServerDataProtectionBuilder PreferDefaultAuthorizationCodeFormat()
Returns
Type | Description |
---|---|
OpenIddictServerDataProtectionBuilder |
PreferDefaultDeviceCodeFormat()
Configures OpenIddict to use the default token format (JWT) when issuing new device codes.
Declaration
public OpenIddictServerDataProtectionBuilder PreferDefaultDeviceCodeFormat()
Returns
Type | Description |
---|---|
OpenIddictServerDataProtectionBuilder |
PreferDefaultRefreshTokenFormat()
Configures OpenIddict to use the default token format (JWT) when issuing new refresh tokens.
Declaration
public OpenIddictServerDataProtectionBuilder PreferDefaultRefreshTokenFormat()
Returns
Type | Description |
---|---|
OpenIddictServerDataProtectionBuilder |
PreferDefaultUserCodeFormat()
Configures OpenIddict to use the default token format (JWT) when issuing new user codes.
Declaration
public OpenIddictServerDataProtectionBuilder PreferDefaultUserCodeFormat()
Returns
Type | Description |
---|---|
OpenIddictServerDataProtectionBuilder |
UseDataProtectionProvider(IDataProtectionProvider)
Configures OpenIddict to use a specific data protection provider instead of relying on the default instance provided by the DI container.
Declaration
public OpenIddictServerDataProtectionBuilder UseDataProtectionProvider(IDataProtectionProvider provider)
Parameters
Type | Name | Description |
---|---|---|
IDataProtectionProvider | provider | The data protection provider used to create token protectors. |
Returns
Type | Description |
---|---|
OpenIddictServerDataProtectionBuilder |
UseFormatter(IOpenIddictServerDataProtectionFormatter)
Configures OpenIddict to use a specific formatter instead of relying on the default instance.
Declaration
public OpenIddictServerDataProtectionBuilder UseFormatter(IOpenIddictServerDataProtectionFormatter formatter)
Parameters
Type | Name | Description |
---|---|---|
IOpenIddictServerDataProtectionFormatter | formatter | The formatter used to read and write tokens. |
Returns
Type | Description |
---|---|
OpenIddictServerDataProtectionBuilder |