Table of Contents

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

applicationContext IApplicationContext

The application context giving the current principal.

Fields

ProviderName

The key (Bootstrap) under which the provider is registered.

public const string ProviderName = "Bootstrap"

Field Value

string

Methods

GetTokenAsync(IKeyValueSettings?, object?)

Gets the token of the current principal.

public ValueTask<Result<TokenInfo>> GetTokenAsync(IKeyValueSettings? settings, object? platformParameters)

Parameters

settings IKeyValueSettings

The provider settings, which must not be null.

platformParameters object

Not used.

Returns

ValueTask<Result<TokenInfo>>

The token, or a failed result when the identity has no token or the token is expired.

Exceptions

ArgumentNullException

settings or the current principal is null.