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
servicesIServiceCollectionThe service collection.
configurationIConfigurationThe configuration.
sectionNamestringThe 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
servicesIServiceCollectionThe service collection.
optionsAction<RemoteSecretSettingsOptions>The action that configures the secret.
optionKeystringThe name under which the settings are registered.
Exceptions
- ConfigurationException
A mandatory field (
HeaderKey,ClientSecret,ProviderId,AuthenticationType) is empty.