Skip to content

Commit

Permalink
Merge pull request #999 from Brady-Conn/jwt-algorithm-options
Browse files Browse the repository at this point in the history
Added algorithm option to jwt policy
  • Loading branch information
XVincentX authored Jul 18, 2020
2 parents c294fa7 + 7ae36e8 commit f77ab36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/policies/jwt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ module.exports = {
type: 'boolean',
default: true,
description: 'Value istructing the gateway whether verify the sub against the internal SOC'
},
algorithms: {
type: 'array',
items: { type: 'string', enum: ['HS256', 'HS384', 'HS512', 'RS256', 'RS384', 'RS512'] },
description: 'If defined, limits valid jwts to specified algorithms'
}
},
required: ['jwtExtractor', 'checkCredentialExistence'],
Expand Down
3 changes: 2 additions & 1 deletion lib/policies/jwt/jwt.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ module.exports = function (params) {
secretOrKey,
jwtFromRequest: extractor,
audience: params.audience,
issuer: params.issuer
issuer: params.issuer,
algorithms: params.algorithms
}, (jwtPayload, done) => {
if (!jwtPayload) {
return done(null, false);
Expand Down

0 comments on commit f77ab36

Please sign in to comment.