Skip to content

Commit

Permalink
feat: JARM is now a stable feature
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Nov 9, 2022
1 parent 85f45aa commit 10e3a37
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 28 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ openid-client.
- [Financial-grade API Security Profile 1.0 - Part 2: Advanced (FAPI)][feature-fapi]
- [JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)][feature-jarm]
- [OAuth 2.0 Demonstration of Proof-of-Possession at the Application Layer (DPoP) - draft 04][feature-dpop]
- [OAuth 2.0 Authorization Server Issuer Identification - draft-04][feature-iss]
- [OAuth 2.0 Authorization Server Issuer Identification][feature-iss]

Updates to draft specifications (DPoP, JARM, etc) are released as MINOR library versions,
if you utilize these specification implementations consider using the tilde `~` operator in your
Expand Down Expand Up @@ -278,7 +278,7 @@ See [Customizing (docs)][documentation-customizing].
[feature-dpop]: https://tools.ietf.org/html/draft-ietf-oauth-dpop-04
[feature-par]: https://www.rfc-editor.org/rfc/rfc9126.html
[feature-jar]: https://www.rfc-editor.org/rfc/rfc9101.html
[feature-iss]: https://datatracker.ietf.org/doc/html/draft-ietf-oauth-iss-auth-resp-04
[feature-iss]: https://www.rfc-editor.org/rfc/rfc9207.html
[openid-certified-link]: https://openid.net/certification/
[passport-url]: http://passportjs.org
[npm-url]: https://www.npmjs.com/package/openid-client
Expand Down
31 changes: 5 additions & 26 deletions lib/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -1606,35 +1606,14 @@ class BaseClient {
fapi() {
return this.constructor.name === 'FAPI1Client';
}
}

/**
* @name validateJARM
* @api private
*/
async function validateJARM(response) {
const expectedAlg = this.authorization_signed_response_alg;
const { payload } = await this.validateJWT(response, expectedAlg, ['iss', 'exp', 'aud']);
return pickCb(payload);
async validateJARM(response) {
const expectedAlg = this.authorization_signed_response_alg;
const { payload } = await this.validateJWT(response, expectedAlg, ['iss', 'exp', 'aud']);
return pickCb(payload);
}
}

Object.defineProperty(BaseClient.prototype, 'validateJARM', {
enumerable: true,
configurable: true,
value(...args) {
process.emitWarning(
"The JARM API implements an OIDF implementer's draft. Breaking draft implementations are included as minor versions of the openid-client library, therefore, the ~ semver operator should be used and close attention be payed to library changelog as well as the drafts themselves.",
'DraftWarning',
);
Object.defineProperty(BaseClient.prototype, 'validateJARM', {
enumerable: true,
configurable: true,
value: validateJARM,
});
return this.validateJARM(...args);
},
});

const RSPS = /^(?:RS|PS)(?:256|384|512)$/;
function determineRsaAlgorithm(privateKey, privateKeyInput, valuesSupported) {
if (
Expand Down

0 comments on commit 10e3a37

Please sign in to comment.