BearerAuthProvider

class BearerAuthProvider(refreshTokens: suspend (response: HttpResponse) -> BearerTokens?, loadTokens: suspend () -> BearerTokens?, sendWithoutRequestCallback: (HttpRequestBuilder) -> Boolean, realm: String?) : AuthProvider

Client bearer AuthProvider.

Constructors

Link copied to clipboard
fun BearerAuthProvider(refreshTokens: suspend (response: HttpResponse) -> BearerTokens?, loadTokens: suspend () -> BearerTokens?, sendWithoutRequestCallback: (HttpRequestBuilder) -> Boolean = { true }, realm: String?)

Functions

Link copied to clipboard
open suspend override fun addRequestHeaders(request: HttpRequestBuilder)

Add authentication method headers and creds.

Link copied to clipboard
suspend fun clearToken()
Link copied to clipboard
open override fun isApplicable(auth: HttpAuthHeader): Boolean

Check if current provider is applicable to the request.

Link copied to clipboard
open suspend override fun refreshToken(response: HttpResponse): Boolean

Refresh token if required.

Link copied to clipboard
open override fun sendWithoutRequest(request: HttpRequestBuilder): Boolean

Properties

Link copied to clipboard
open override val sendWithoutRequest: Boolean

Wait for HttpStatusCode.Unauthorized to send credentials.