ResponseWithDpopNonce

data class ResponseWithDpopNonce<T> @JvmOverloads constructor(val response: T, val dpopNonce: String?, val attestationChallenge: String? = null)(source)

Implements RFC 9449 8.2.: Authorization servers may include a fresh DPoP nonce by including values in HTTP 200 responses, and OA-ABCA 6.2 likewise for attestation challenges.

Send it converted with toHttpResponse(), which sets the headers.

Constructors

Link copied to clipboard
constructor(response: T, dpopNonce: String?, attestationChallenge: String? = null)

Properties

Link copied to clipboard

Sent as HTTP header OAuth-Client-Attestation-Challenge, see HttpHeaders.OAuthClientAttestationChallenge

Link copied to clipboard

Sent as HTTP header DPoP-Nonce, see HttpHeaders.DPoPNonce

Link copied to clipboard
val response: T

Functions

Link copied to clipboard

Converts the result of the pushed authorization request endpoint to its response: status 201 with the parameters as JSON (RFC 9126 2.2), and the headers DPoP-Nonce and OAuth-Client-Attestation-Challenge, if present.

Converts the result of the token endpoint to its response: status 200 with the token response as JSON, the headers Cache-Control: no-store and Pragma: no-cache (RFC 6749 5.1), and the headers DPoP-Nonce and OAuth-Client-Attestation-Challenge, if present.

@JvmName(name = "userInfoToHttpResponse")
fun ResponseWithDpopNonce<JsonObject>.toHttpResponse(): PreparedHttpResponse

Converts the result of the userinfo endpoint to its response: status 200 with the user info as JSON (OpenID Connect Core 5.3.2), and the header DPoP-Nonce, if present.