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

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 a token when the 401 status code is received.

Link copied to clipboard

Sends credentials without waiting for HttpStatusCode.Unauthorized.