feat(jar): JWT-Secured Authorization Requests (JAR) support - #863
Merged
Merged
Conversation
This was referenced Jul 24, 2026
Contributor
Author
|
Addressed the nits in 7ff0457:
Full suite and tsd green. |
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.
…s example The example dispatcher referenced 'hri.js', which does not exist in the codebase (only examples/jar.js ships in this PR). Rename the leftover 'hri-client' registered client to 'jar-client' across the example dispatcher, the e2e fixture, the JAR e2e test, and the example comment so the example, its comment, and the fixture client agree.
|
|
||
| The request object's `aud` is set to the issuer identifier advertised in the discovery document (which may differ from `issuerBaseURL`, e.g. a trailing slash), as JAR requires. `requestObjectSigningKey` accepts the same key formats as `clientAssertionSigningKey` (PEM string, Buffer, KeyObject, JWK, CryptoKey). | ||
|
|
||
| Full example at [jar.js](./examples/jar.js), to run it: `npm run start:example -- jar` |
Contributor
There was a problem hiding this comment.
Hey @jd3vi1 based on the example added for this change, the accepted command to run the example app would be
npm run start:example -- jar.js
or
npm run start:example -- jarCan you please check ?
Contributor
Author
There was a problem hiding this comment.
i've made it agnostic of the extension, both should work now.
|
|
||
| ## 16. JWT-Secured Authorization Requests (JAR) | ||
|
|
||
| [JAR](https://www.rfc-editor.org/rfc/rfc9101.html) (part of Auth0's Highly Regulated Identity feature set) signs all authorization parameters into a JWT and sends them as the `request` parameter, so the `/authorize` redirect carries only `client_id` and `request`. Set `requestObjectSigningKey` to enable it. `requestObjectSigningAlg` is always required, since Web Crypto algorithm names are not valid JWA `alg` values. |
Contributor
There was a problem hiding this comment.
@jd3vi1 we should showcase or provide some reference how users can get/generate requestObjectSigningKey and also reference for allowed requestObjectSigningAlg
run_example.js now strips a trailing `.js` from the example argument so `npm run start:example -- jar` (as documented) selects the JAR-capable `jar-client`, matching the `-- jar.js` form. EXAMPLES.md now lists the accepted `requestObjectSigningAlg` values and shows how to generate an RSA or EC signing key pair for JAR.
gyaneshgouraw
approved these changes
Aug 6, 2026
Merged
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.