The verification options
OptionalauthorizationRequestJwt?: { jwt: string; signer: JwtSigner }The authorization request JWT to verify. If this value was returned from parsePushedAuthorizationRequest
you MUST provide this value to ensure the JWT is verified.
Authorization Server metadata for enforcing JAR signing policy. Includes standard Authorization Server metadata plus require_signed_request_object. When require_signed_request_object is true, the server will reject unsigned requests. Defaults to false (permissive) if not provided.
Optionaldpop?: VerifyAuthorizationRequestDPoPOptionalnow?: DateThe current time to use when verifying the JWTs. If not provided current time will be used.
A promise resolving to verification results containing:
jar - Verified JAR request including decoded payload and signer (if JAR was provided)dpop - Verified DPoP information including JWK and thumbprint (if DPoP was provided)clientAttestation - Verified client attestation JWTs (if client attestation was provided)When DPoP and client attestation keys don't match (if ensureConfirmationKeyMatchesDpopKey is true)
// Example 1: Enforce signed JAR (strict mode)
const result = await verifyPushedAuthorizationRequest({
authorizationRequest: parsed.authorizationRequest,
authorizationServerMetadata: {
issuer: 'https://auth.example.com',
require_signed_request_object: true // Reject unsigned requests
},
callbacks: { hash: hashCallback, verifyJwt: verifyJwtCallback },
authorizationRequestJwt: {
jwt: parsed.authorizationRequestJwt,
signer: clientSignerFromFederation
},
request: httpRequest
});
// Example 2: Accept both signed and unsigned (permissive mode)
const result = await verifyPushedAuthorizationRequest({
authorizationRequest: parsed.authorizationRequest,
authorizationServerMetadata: {
issuer: 'https://auth.example.com',
require_signed_request_object: false // Accept unsigned requests
},
callbacks: { hash: hashCallback, verifyJwt: verifyJwtCallback },
authorizationRequestJwt: parsed.authorizationRequestJwt ? {
jwt: parsed.authorizationRequestJwt,
signer: clientSignerFromFederation
} : undefined,
request: httpRequest
});
Verifies a pushed authorization request (PAR) including JAR, DPoP, and client attestation.
This function extends
verifyAuthorizationRequestby adding support for JWT-secured Authorization Requests (JAR). It performs comprehensive verification of all security mechanisms used in pushed authorization requests according to RFC 9126 (PAR) and RFC 9101 (JAR).The verification process includes:
JAR Signing Policy (RFC 9101): When
authorizationServerMetadata.require_signed_request_objectis true:Important: Use
parsePushedAuthorizationRequestfirst to extract the necessary JWTs from request headers and body.