-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnauthorizedError: No authorization token was found – despite valid token #269
Comments
👋 @axhl You don't need to provide a custom For your reference, the default implementation is here https://github.com/auth0/express-jwt/blob/master/lib/index.js#L58-L74 |
@adamjmcgrath many thanks for replying so far. Unfortunately I made a mistake when pasting the code: getToken: function (req) {
if (req.headers.authorization) return req.headers.authorization;
}, has already been removed and the error persists. (I've updated the code above to reflect that for later arrivals to the thread). Any thoughts what could be up apart from the |
Hi @axhl - can't see anything wrong with your code. Happy to debug a sample project if you can share a minimal reproduction of the issue |
Huge thanks @adamjmcgrath for offering to be so generous with your time. I think I've made progress: As Any thoughts on how to best wrap wrap sockets with jwt-verification? |
@axhl - no problem It doesn't sound like you need
I'm not sure about graph-ql specifically, but this looks like the sort of thing I'd do for authenticating Web Sockets with JWTs https://gist.github.com/jfromaniello/8418116 |
express-jwt
refuses to parse a valid token, and I cannot for the life of me understand why :Reproduction
The following client-side code uses
graphql-ws
to include a token in a request via Relay:The token is visible in the network requests when there is an open
express
-server on the other end.On the server-side, the request is then parsed as follows:
This renders a
UnauthorizedError: No authorization token was found
error message.Grateful for any community input
relevant dependencies
The text was updated successfully, but these errors were encountered: