examples
examples copied to clipboard
aws-node-auth0-custom-authorizers-api Private API returned 401
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:
- Add
algorithms: ["HS256"]
to options passed tojwt.verify()
. - Change
AUTH0_CLIENT_PUBLIC_KEY
tonew Buffer(AUTH0_CLIENT_PUBLIC_KEY, "base64")
when passing tojwt.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?
I was able to solve this by replacing AUTH0_CLIENT_PUBLIC_KEY
with Client secret
from Auth0.
What I did was correct?