Class BootstrapContextTokenProvider
- Namespace
- Arc4u.OAuth2.TokenProviders
- Assembly
- Arc4u.OAuth2.AspNetCore.Authentication.dll
An ITokenProvider that returns the access token stored in the BootstrapContext of the current principal, that is the token of the incoming request.
[Export("Bootstrap", typeof(ITokenProvider))]
public class BootstrapContextTokenProvider : ITokenProvider
- Inheritance
-
BootstrapContextTokenProvider
- Implements
- Inherited Members
Constructors
BootstrapContextTokenProvider(IApplicationContext)
An ITokenProvider that returns the access token stored in the BootstrapContext of the current principal, that is the token of the incoming request.
public BootstrapContextTokenProvider(IApplicationContext applicationContext)
Parameters
applicationContextIApplicationContextThe application context giving the current principal.
Fields
ProviderName
The key (Bootstrap) under which the provider is registered.
public const string ProviderName = "Bootstrap"
Field Value
Methods
GetTokenAsync(IKeyValueSettings?, object?)
Gets the token of the current principal.
public ValueTask<Result<TokenInfo>> GetTokenAsync(IKeyValueSettings? settings, object? platformParameters)
Parameters
settingsIKeyValueSettingsThe provider settings, which must not be null.
platformParametersobjectNot used.
Returns
- ValueTask<Result<TokenInfo>>
The token, or a failed result when the identity has no token or the token is expired.
Exceptions
- ArgumentNullException
settingsor the current principal is null.