BearerChallengeUnauthorizedHandler

An UnauthorizedHandler that includes a WWW-Authenticate: Bearer challenge on 401 responses.

Enable by setting bearerChallenge = true in the opaqueToken { } block (optional realm, default "API"). The response body is empty; only the challenge header is sent. When failure is an AuthenticationResult.Failure, the header includes error="invalid_token"; when the caller was simply unauthenticated, failure is null and no error attribute is included.

Constructors

Link copied to clipboard
constructor(realm: String = "API")

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open override fun handle(context: Context, failure: AuthenticationResult.Failure?)