serverless / serverless/examples
aws-node-auth0-custom-authorizers-api Private API returned 401
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 11.5k
- Forks
- 4.4k
- Avg merge
- 2h 55m
- Merged PRs (30d)
- 3
Description
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_KEYtonew 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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with handler.js around line 45, where the stack trace shows jwt.verify() failing, and compare the token and verification configuration used by the public and private API paths. Reproduce the example with the documented local frontend setup and inspect the authorizer logs. Done means a valid login token is accepted by the private API without the invalid-signature 401.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, javascript
- Domain
- api, authentication, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100