OAuth2Error

@Serializable
data class OAuth2Error(val error: String, val errorDescription: String? = null, val description: String? = null, val errorUri: String? = null, val state: String? = null)(source)

The OAuth 2.0 Authorization Framework: Error responses, see RFC 6749.

Constructors

Link copied to clipboard
constructor(error: String, errorDescription: String? = null, description: String? = null, errorUri: String? = null, state: String? = null)

Properties

Link copied to clipboard
@SerialName(value = "description")
val description: String?

Not covered by the spec, but some servers put the description into this field

Link copied to clipboard
@SerialName(value = "error")
val error: String

A single ASCII error code, see at.asitplus.openid.OpenIdConstants.Errors.

Link copied to clipboard
@SerialName(value = "error_description")
val errorDescription: String?

OPTIONAL. Human-readable ASCII text providing additional information, used to assist the client developer in understanding the error that occurred. Values for the errorDescription parameter MUST NOT include characters outside the set %x20-21 / %x23-5B / %x5D-7E.

Link copied to clipboard
@SerialName(value = "error_uri")
val errorUri: String?

OPTIONAL. A URI identifying a human-readable web page with information about the error, used to provide the client developer with additional information about the error. Values for the errorUri parameter MUST conform to the URI-reference syntax and thus MUST NOT include characters outside the set %x21 / %x23-5B / %x5D-7E.

Link copied to clipboard
@SerialName(value = "state")
val state: String?

REQUIRED if a state parameter was present in the client authorization request. The exact value received from the client.

Functions

Link copied to clipboard
fun OAuth2Error?.attestationChallenge(headers: Headers): String?

Extracts the header OAuth-Client-Attestation-Challenge from the headers of an error response, if the error is use_attestation_challenge.

Link copied to clipboard
fun OAuth2Error?.dpopNonce(headers: Headers): String?

Extracts the header DPoP-Nonce from the headers of an error response, if the authorization server responded with the error use_dpop_nonce, or the resource server did so in the header WWW-Authenticate.