Allow unsigned (alg: none) JWT tokens
See original GitHub issueI’m using the firebase auth emulator for local development which produces unsigned tokens. I’m running the firebase auth emulator and hasura (v1.3.3) locally using docker. It seems that hasura views the unsigned tokens using the recommended HASURA_GRAPHQL_JWT_SECRET for firebase as invalid. When I remove the HASURA_GRAPHQL_JWT_SECRET, all requests are defaulted to the anonymous role, which doesn’t represent the actual role of the user from the unsigned token.
Is there a flag to allow using unsigned JWT tokens for development purposes? Or am I missing something with my configuration?
Hasura has been a major productivity boost for me! Just having this small issue setting up my local environment
Issue Analytics
- State:
- Created 3 years ago
- Reactions:23
- Comments:14 (1 by maintainers)
Top Results From Across the Web
Hacking JWT Tokens: The None Algorithm | by Shivam Bathla
Using base64 utility to generate the forged token. Changing the signing algorithm to “none”: Command: echo -n '{“typ”:”JWT”,”alg”: ...
Read more >Critical vulnerabilities in JSON Web Token libraries - Auth0
The none algorithm is a curious addition to JWT. It is intended to be used for situations where the integrity of the token...
Read more >JWT none algorithm supported - PortSwigger
When this algorithm is supported on the server, it may accept tokens that have ... the "none" algorithm, which can be used with...
Read more >If there are libraries that silently accept an unsigned JWT with ...
If there are libraries that silently accept an unsigned JWT with alg:none, even when they are provided a secret key to verify, that's...
Read more >11 JWT Token Security Best Practices | Curity
The special case of a none value in the alg claim tells clients that the JWS is actually not signed. This option is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Hashnode Post
No results found

I also just ran into this issue. I would agree in having the
noneoption on Hasura’s JWT secret for local testing and development. Does anyone know a work around for this in the meanwhile?Update Here is my current work around. I’m using Apollo with NextJS and I just added some middleware to handle the checking of environments. If the environment is local(where I’m using firebase emulator), it signs the token on request.
Remember to set the secret to use a key instead of the firebase JWK
I would still LOVE a type of
noneon theHASURA_GRAPHQL_JWT_SECRETthough 😃.@tirumaraiselvan Yes, it appears the algorithm is none, which doesn’t appear to be specified in the JWT standard, but it’d be super handy if Hasura could support. This would allow for completely local development - without touching a remote auth server at all.
Here’s a dump of one of the tokens produced by the mentioned auth emulator:
Headers:
Full payload:
Given that the token has an issuer and audience, it may be possible to allow a “type” of “none” only when one (or both) of these are specified.