Skip to content

Commit

Permalink
and only validate when present
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Jul 4, 2017
1 parent fd4ff95 commit cba06d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/actions/authorization/decode_request.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ module.exports = (provider) => {

if (alg !== 'none') {
try {
const opts = { issuer: client.clientId, audience: provider.issuer };
const opts = {
issuer: payload.iss ? client.clientId : undefined,
audience: payload.aud ? provider.issuer : undefined,
};
await JWT.verify(params.request, client.keystore, opts);
} catch (err) {
ctx.throw(400, 'invalid_request_object', {
Expand Down

0 comments on commit cba06d7

Please sign in to comment.