Table of Contents

Class UserPasswordScenario

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

grant_type=password style scenario taking the user name and password as two separate fields. The values are projected into the User/Password keys consumed by the cache-backed CredentialTokenCacheTokenProvider, which performs the STS call and caches the resulting token.

Reads its values from the Settings bag.

Use the BasicScenario instead when the credential is supplied as a single user:password (Basic) pair.

public sealed class UserPasswordScenario : IClientTokenScenario
Inheritance
UserPasswordScenario
Implements
Inherited Members

Fields

Name

The discriminator under which this scenario is registered.

public const string Name = "UserPassword"

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