BearerAuthConfig

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard

Configures whether to cache the result of loadTokens.

Link copied to clipboard

When enabled, token refresh function is executed in a NonCancellable coroutine context. This prevents cancellation of the originating request from rolling back a successful token refresh.

Link copied to clipboard

Specifies the authentication realm this provider should answer.

Functions

Link copied to clipboard
fun loadTokens(block: suspend () -> BearerTokens?)

Configures a callback that loads a cached token from a local storage. Note: Using the same client instance here to make a request will result in a deadlock.

Link copied to clipboard

Configures a callback that refreshes bearer tokens when the client receives an unauthorized response.

Link copied to clipboard

Configures when bearer credentials are sent without waiting for HttpStatusCode.Unauthorized.