express-jwt icon indicating copy to clipboard operation
express-jwt copied to clipboard

Update README.md

Open vit100 opened this issue 5 years ago • 1 comments

Added reference to jwks-rsa project with sample code

vit100 avatar Apr 30 '19 17:04 vit100

Unfortunately this will no longer work with v7 as I changed the signature of the secret function:

https://github.com/auth0/node-jwks-rsa/blob/master/src/integrations/express.js#L25-L36

We will need to change this to something like this:

  return async function secretProvider(req, token) {
    if (!token.header.alg || !supportedAlg.includes(token.header.alg)) {
      return;
    }
    const key = await client.getSigningKey(token.header.kid);
    return key.publicKey || key.rsaPublicKey;
  };

jfromaniello avatar Apr 20 '22 12:04 jfromaniello