Table of Contents

Class RemoteSecretsExtension

Namespace
Arc4u.OAuth2.Extensions
Assembly
Arc4u.OAuth2.AspNetCore.dll

Registers the remote secrets: named SimpleKeyValueSettings consumed by the RemoteSecret token provider.

public static class RemoteSecretsExtension
Inheritance
RemoteSecretsExtension
Inherited Members

Methods

AddRemoteSecretsAuthentication(IServiceCollection, IConfiguration, string)

Registers the remote secrets of a configuration section: each child of the section is a RemoteSecretSettingsOptions registered under the name of the child. Nothing is registered when the section does not exist or is empty.

public static void AddRemoteSecretsAuthentication(this IServiceCollection services, IConfiguration configuration, string sectionName = "Authentication:RemoteSecrets")

Parameters

services IServiceCollection

The service collection.

configuration IConfiguration

The configuration.

sectionName string

The section holding the secrets. The default is Authentication:RemoteSecrets.

Examples

services.AddRemoteSecretsAuthentication(configuration);

Exceptions

ConfigurationException

A mandatory field (HeaderKey, ClientSecret, ProviderId, AuthenticationType) is empty.

AddRemoteSecretsAuthentication(IServiceCollection, Action<RemoteSecretSettingsOptions>, string)

Registers one remote secret from code.

public static void AddRemoteSecretsAuthentication(this IServiceCollection services, Action<RemoteSecretSettingsOptions> options, string optionKey)

Parameters

services IServiceCollection

The service collection.

options Action<RemoteSecretSettingsOptions>

The action that configures the secret.

optionKey string

The name under which the settings are registered.

Exceptions

ConfigurationException

A mandatory field (HeaderKey, ClientSecret, ProviderId, AuthenticationType) is empty.