Skip to content

Commit

Permalink
Fix for #53
Browse files Browse the repository at this point in the history
  • Loading branch information
vlad-ignatov committed Jun 12, 2021
1 parent a0e4350 commit 101eaca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/TokenHandler.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
const crypto = require("crypto");
const jwt = require("jsonwebtoken");
const base64url = require("base64-url");
const jwkToPem = require("jwk-to-pem");
const config = require("./config");
const SMARTHandler = require("./SMARTHandler");
Expand Down Expand Up @@ -119,7 +118,9 @@ class TokenHandler extends SMARTHandler {
}

try {
jwt.verify(req.body.client_assertion, base64url.decode(clientDetailsToken.pub_key), { algorithm: "RS256" });
jwt.verify(req.body.client_assertion, clientDetailsToken.pub_key, {
algorithms: [ "RS256", "RS384", "RS512", "ES256", "ES384", "ES512" ]
});
} catch (e) {
return Lib.replyWithError(res, "invalid_token", 401, e.message);
}
Expand Down

0 comments on commit 101eaca

Please sign in to comment.