examples icon indicating copy to clipboard operation
examples copied to clipboard

aws-node-auth0-custom-authorizers-api Private API returned 401

Open sulaysumaria opened this issue 5 years ago • 1 comments

I tried running aws-node-auth0-custom-authorizers-api. It logins successfully, public API is called successfully. But private API returns 401 with following error:

I had make a few changes also:

  1. Add algorithms: ["HS256"] to options passed to jwt.verify().
  2. Change AUTH0_CLIENT_PUBLIC_KEY to new Buffer(AUTH0_CLIENT_PUBLIC_KEY, "base64") when passing to jwt.verify().
verifyError { JsonWebTokenError: invalid signature
at /var/task/node_modules/jsonwebtoken/verify.js:133:19
at getSecret (/var/task/node_modules/jsonwebtoken/verify.js:90:14)
at Object.module.exports [as verify] (/var/task/node_modules/jsonwebtoken/verify.js:94:10)
at module.exports.auth (/var/task/handler.js:45:9) name: 'JsonWebTokenError', message: 'invalid signature' }

I am using serve for hosting frontend locally. FE is live on http://localhost:5000/

Any suggestions?

sulaysumaria avatar Jun 10 '19 08:06 sulaysumaria

I was able to solve this by replacing AUTH0_CLIENT_PUBLIC_KEY with Client secret from Auth0. What I did was correct?

ghost avatar Jun 10 '19 09:06 ghost