Table of Contents

Namespace Arc4u.OAuth2.TokenProvider

Classes

BlazorMsalTokenProvider

Provides an implementation of ITokenProvider for Blazor applications using MSAL.

BlazorTokenProvider

Provides an implementation of ITokenProvider for Blazor applications.

ClientCredentialsTokenProvider

grant_type=client_credentials token provider authenticating the client with the client_secret_basic method: the ClientId/ClientSecret pair is sent in the HTTP Authorization: Basic base64(client_id:client_secret) header, while the scope and any extra parameter (e.g. resource) travel in the form body.

It consumes the settings produced by ClientCredentialsScenario and caches the acquired application token by client + scope + authority, refreshing it close to expiry.

ClientTokenProvider

An ITokenProvider for a Blazor WebAssembly application whose token is given by its server backend. The token is requested with a GET on the TokenRequestUrl of the settings, through the HttpClient named by HttpClientName (see AddAuthenticationCookie), and kept until it expires.

CredentialTokenCacheTokenProvider

An ITokenProvider for user name and password credentials. The token is cached (key: authority, scope, user and a hash of the password) and requested again through the ICredentialTokenProvider registered as CredentialDirect when it is missing or expires in less than one minute.

CredentialTokenProvider

An ICredentialTokenProvider that requests a token from the token endpoint of an authority with the OAuth2 resource owner password grant. The provider is registered under the name ProviderName. The authority is read from the Authority key of the settings (or the Default authority), the ClientId, optional ClientSecret and Scope (default openid) keys come from the settings too. Failing requests are retried during RetryInterval (90 seconds by default).

RemoteClientSecretTokenProvider

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.

TokenJsonContext

The source generated JSON serialization context used to read the token returned by the server.