Class RemoteClientSecretTokenProvider
- Namespace
- Arc4u.OAuth2.TokenProvider
- Assembly
- Arc4u.OAuth2.AspNetCore.dll
An ITokenProvider that does not call an authority: it wraps the remote secret of the settings (ClientSecret) in a TokenInfo valid for one hour,
using the header name of the settings (ClientSecretHeader) as token type.
When the header is Basic, a clear user:password secret is Base64 encoded; a secret already Base64 encoded is sent as is.
[Export("RemoteSecret", typeof(ITokenProvider))]
[Shared]
public class RemoteClientSecretTokenProvider : ITokenProvider
- Inheritance
-
RemoteClientSecretTokenProvider
- Implements
- Inherited Members
Fields
ProviderName
The key (RemoteSecret) under which the provider is registered.
public const string ProviderName = "RemoteSecret"
Field Value
Methods
GetTokenAsync(IKeyValueSettings?, object?)
Gets the token wrapping the remote secret.
public ValueTask<Result<TokenInfo>> GetTokenAsync(IKeyValueSettings? settings, object? _)
Parameters
settingsIKeyValueSettingsThe provider settings.
_objectNot used.
Returns
- ValueTask<Result<TokenInfo>>
The token, or a failed result when the header name is not in the settings.
Exceptions
- ArgumentNullException
settingsis null.- ConfigurationException
The settings have no client secret.