Table of Contents

Class ClientCredentialsScenario

Namespace
Arc4u.OAuth2.TokenProvider.Scenarios
Assembly
Arc4u.OAuth2.AspNetCore.dll

grant_type=client_credentials scenario: a ClientId + ClientSecret pair. Any other key in Settings (e.g. the Logto.io resource indicator) is not claimed by this scenario and is forwarded to the token endpoint as an extra parameter.

public sealed class ClientCredentialsScenario : IClientTokenScenario
Inheritance
ClientCredentialsScenario
Implements
Inherited Members

Fields

Name

The discriminator under which this scenario is registered.

public const string Name = "ClientCredentials"

Field Value

string

ProviderName

The token provider (ProviderId) that consumes settings produced by this scenario.

public const string ProviderName = "ClientCredentials"

Field Value

string

Properties

KnownKeys

The keys in Settings this scenario consumes. Any other key present in Settings is forwarded verbatim to the token endpoint as an extra request parameter. Should use a case-insensitive comparer.

public IReadOnlyCollection<string> KnownKeys { get; }

Property Value

IReadOnlyCollection<string>

Methods

Validate(string, ClientTokenSettingsOptions)

Validates the bound options. Implementations throw a ConfigurationException when the configuration is invalid. Invoked eagerly, before the service provider is built.

public void Validate(string optionKey, ClientTokenSettingsOptions options)

Parameters

optionKey string
options ClientTokenSettingsOptions

WriteTo(string, ClientTokenSettingsOptions, SimpleKeyValueSettings)

Projects the bound options into the flat SimpleKeyValueSettings consumed by the token provider.

public void WriteTo(string optionKey, ClientTokenSettingsOptions options, SimpleKeyValueSettings settings)

Parameters

optionKey string
options ClientTokenSettingsOptions
settings SimpleKeyValueSettings