Class OpenIddictServerBuilder
Exposes the necessary methods required to configure the OpenIddict server services.
Inheritance
Inherited Members
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: cs.temp.dll.dll
Syntax
public class OpenIddictServerBuilder
Constructors
OpenIddictServerBuilder(IServiceCollection)
Initializes a new instance of OpenIddictServerBuilder.
Declaration
public OpenIddictServerBuilder(IServiceCollection services)
Parameters
| Type | Name | Description |
|---|---|---|
| IServiceCollection | services | The services collection. |
Methods
AcceptAnonymousClients()
Makes client identification optional so that token, introspection and revocation requests that don't specify a client_id are not automatically rejected. Enabling this option is NOT recommended.
Declaration
public OpenIddictServerBuilder AcceptAnonymousClients()
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
AddDevelopmentEncryptionCertificate()
Registers (and generates if necessary) a user-specific development encryption certificate.
Declaration
public OpenIddictServerBuilder AddDevelopmentEncryptionCertificate()
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
AddDevelopmentEncryptionCertificate(X500DistinguishedName)
Registers (and generates if necessary) a user-specific development encryption certificate.
Declaration
public OpenIddictServerBuilder AddDevelopmentEncryptionCertificate(X500DistinguishedName subject)
Parameters
| Type | Name | Description |
|---|---|---|
| X500DistinguishedName | subject | The subject name associated with the certificate. |
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
AddEncryptionCredentials(EncryptingCredentials)
Registers encryption credentials.
Declaration
public OpenIddictServerBuilder AddEncryptionCredentials(EncryptingCredentials credentials)
Parameters
| Type | Name | Description |
|---|---|---|
| EncryptingCredentials | credentials | The encrypting credentials. |
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
AddEncryptionKey(SecurityKey)
Registers an encryption key.
Declaration
public OpenIddictServerBuilder AddEncryptionKey(SecurityKey key)
Parameters
| Type | Name | Description |
|---|---|---|
| SecurityKey | key | The security key. |
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
AddEphemeralEncryptionKey()
Registers a new ephemeral encryption key. Ephemeral encryption keys are automatically discarded when the application shuts down and payloads encrypted using this key are automatically invalidated. This method should only be used during development. On production, using a X.509 certificate stored in the machine store is recommended.
Declaration
public OpenIddictServerBuilder AddEphemeralEncryptionKey()
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
AddEphemeralEncryptionKey(String)
Registers a new ephemeral encryption key. Ephemeral encryption keys are automatically discarded when the application shuts down and payloads encrypted using this key are automatically invalidated. This method should only be used during development. On production, using a X.509 certificate stored in the machine store is recommended.
Declaration
public OpenIddictServerBuilder AddEphemeralEncryptionKey(string algorithm)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | algorithm | The algorithm associated with the encryption key. |
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
AddEventHandler(OpenIddictServerHandlerDescriptor)
Registers an event handler using the specified descriptor.
Declaration
public OpenIddictServerBuilder AddEventHandler(OpenIddictServerHandlerDescriptor descriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| OpenIddictServerHandlerDescriptor | descriptor | The handler descriptor. |
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
AddEventHandler<TContext>(Action<OpenIddictServerHandlerDescriptor.Builder<TContext>>)
Registers an event handler using the specified configuration delegate.
Declaration
public OpenIddictServerBuilder AddEventHandler<TContext>(Action<OpenIddictServerHandlerDescriptor.Builder<TContext>> configuration)
where TContext : OpenIddictServerEvents.BaseContext
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<OpenIddictServerHandlerDescriptor.Builder<TContext>> | configuration | The configuration delegate. |
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
Type Parameters
| Name | Description |
|---|---|
| TContext | The event context type. |
Configure(Action<OpenIddictServerOptions>)
Amends the default OpenIddict server configuration.
Declaration
public OpenIddictServerBuilder Configure(Action<OpenIddictServerOptions> configuration)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Action<OpenIddictServerOptions> | configuration | The delegate used to configure the OpenIddict options. |
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |
Remarks
This extension can be safely called multiple times.
RemoveEventHandler(OpenIddictServerHandlerDescriptor)
Removes the event handler that matches the specified descriptor.
Declaration
public OpenIddictServerBuilder RemoveEventHandler(OpenIddictServerHandlerDescriptor descriptor)
Parameters
| Type | Name | Description |
|---|---|---|
| OpenIddictServerHandlerDescriptor | descriptor | The descriptor corresponding to the handler to remove. |
Returns
| Type | Description |
|---|---|
| OpenIddictServerBuilder |