feat(jar): JWT-Secured Authorization Requests (JAR) support#863
Open
jd3vi1 wants to merge 2 commits into
Open
Conversation
This was referenced Jul 24, 2026
Sign authorization request parameters into a JWT and send them as the `request` parameter (RFC 9101). Enabled by setting `requestObjectSigningKey` with a required `requestObjectSigningAlg`. Works alongside PAR, and the request object's `aud` is set to the discovered issuer identifier.
…ing key Address review feedback on JAR: - buildRequestObject now requires the discovered issuer as its audience instead of falling back to issuerBaseURL, which produced the invalid_request_object mismatch the spec warns against. Tests pass the discovered issuer explicitly. - Reject an empty-string requestObjectSigningKey at config validation so the 'is set' check is consistent (Joi treated '' as set while the login-side check skipped JAR, silently disabling it). - Add tests: buildRequestObject throws without audience, and the non-PAR authorize redirect carries only client_id and request.
Contributor
Author
|
Addressed the nits in 7ff0457:
Full suite and tsd green. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for JWT-Secured Authorization Requests (JAR, RFC 9101). When
requestObjectSigningKeyis configured, the SDK signs all authorization parameters into a JWT and sends it as therequestparameter, so the/authorizeredirect carries onlyclient_idandrequest.What's included
requestObjectSigningKey— private key used to sign the request object. Accepts the same formats asclientAssertionSigningKey(PEM string, Buffer, KeyObject, JWK, CryptoKey).requestObjectSigningAlg— required wheneverrequestObjectSigningKeyis set. Web Crypto algorithm names are not valid JWAalgvalues, so an explicit JWA algorithm is required (a sharedASYMMETRIC_SIGNING_ALGSlist is used, matchingclientAssertionSigningAlg).requestObjectSigningKeyId— optionalkidheader on the request object JWT./oauth/par, which is the recommended FAPI pattern.audis set to the issuer identifier advertised in the discovery document (which may differ fromissuerBaseURL, e.g. a trailing slash), as JAR requires.Usage
Tests
buildRequestObject(header,kid, standard claims,aud), config validation (alg required with key), and the login redirect (requestparam present, PAR combination).index.test-d.ts.EXAMPLES.mdand a runnable example atexamples/jar.js.