Class HonuaOAuthAuthorizationCodeTokenProvider
- Namespace
- Honua.Sdk.Abstractions.Authentication
- Assembly
- Honua.Sdk.Abstractions.dll
OAuth/OIDC authorization-code provider with in-memory access-token refresh.
public sealed class HonuaOAuthAuthorizationCodeTokenProvider : IHonuaAccessTokenProvider
- Inheritance
-
HonuaOAuthAuthorizationCodeTokenProvider
- Implements
- Inherited Members
Constructors
HonuaOAuthAuthorizationCodeTokenProvider(HttpClient, HonuaOAuthAuthorizationCodeTokenProviderOptions)
Initializes a new instance of the HonuaOAuthAuthorizationCodeTokenProvider class.
public HonuaOAuthAuthorizationCodeTokenProvider(HttpClient httpClient, HonuaOAuthAuthorizationCodeTokenProviderOptions options)
Parameters
httpClientHttpClientHTTP client used to call the token endpoint.
optionsHonuaOAuthAuthorizationCodeTokenProviderOptionsProvider options.
Methods
GetAccessTokenAsync(HonuaAuthenticationRequest, CancellationToken)
Gets the current access token for the supplied SDK request context.
public ValueTask<HonuaAccessToken?> GetAccessTokenAsync(HonuaAuthenticationRequest request, CancellationToken cancellationToken = default)
Parameters
requestHonuaAuthenticationRequestAuthentication request context.
cancellationTokenCancellationTokenCancellation token.
Returns
- ValueTask<HonuaAccessToken>
An access token, or null to omit the authorization credential.