Skip to content

Commit

Permalink
fix: ensure non-whitelisted JWA algs cannot be used by _jwt client auth
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Sep 26, 2018
1 parent 8cb37ff commit 186de0d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lib/shared/token_auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,15 @@ module.exports = function tokenAuth(provider, endpoint) {
case 'client_secret_jwt':
await tokenJwtAuth(
ctx, ctx.oidc.client.keystore,
signingAlg ? [signingAlg] : ['HS256', 'HS384', 'HS512'],
signingAlg ? [signingAlg] : instance(provider).configuration(`${endpoint}EndpointAuthSigningAlgValues`).filter(alg => alg.startsWith('HS')),
);

break;

case 'private_key_jwt':
await tokenJwtAuth(
ctx, ctx.oidc.client.keystore,
signingAlg
? [signingAlg] : ['ES256', 'ES384', 'ES512', 'RS256', 'RS384', 'RS512', 'PS256', 'PS384', 'PS512'],
signingAlg ? [signingAlg] : instance(provider).configuration(`${endpoint}EndpointAuthSigningAlgValues`).filter(alg => !alg.startsWith('HS')),
);

break;
Expand Down

0 comments on commit 186de0d

Please sign in to comment.