Class ClientCredentialsAccessTokenProvider

Assembly: redb.Identity.Client.dll

implementation using OAuth2 client_credentials grant.
Caches the access token until ~1 minute before expiry. Use for CLI / server-to-server
scenarios. Web should provide its own per-request HttpContext-based provider.

public sealed class ClientCredentialsAccessTokenProvider : IAccessTokenProvider, IDisposable

Inheritance

Object→ClientCredentialsAccessTokenProvider

Implements

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

GetAccessTokenAsync(CancellationToken)

public Task<string?> GetAccessTokenAsync(CancellationToken ct = default)

Constructors

ClientCredentialsAccessTokenProvider(HttpClient, IOptions<IdentityClientOptions>)

The token comes from the token_endpoint of the discovery document at