Graphql-engine: Claims key: 'https://hasura.io/jwt/claims' not found

Created on 25 Dec 2019  路  5Comments  路  Source: hasura/graphql-engine

i am getting following error:

"claims key: 'https://hasura.io/jwt/claims' not found"

image

question supporneeds-more-info

All 5 comments

@ChaituVR What service are you using to issue JWTs? Have you configured it to add the claims as mentioned here: https://docs.hasura.io/1.0/graphql/manual/auth/authentication/jwt.html#the-spec

Sorry my bad... i was using Firebase existing project.. and i was using existing email which doesn't have custom claims, after checking with new emails that has customClaims.. it is working :stuck_out_tongue:

return admin
    .auth()
    .setCustomUserClaims(user.uid, customClaims)
    .then(() => {

do we have any option to add custom claims to existing users ? (Just curious)

I think you can go through all users once using the admin sdk and add the required claims as a one-time job.

edit: Found out my issue was with my auth0 function setting the claims on idToken instead of accessToken.

Hi, I'm experiencing this issue and would appreciate some help. I have a nextjs application using auth0. I'm trying to add auth0 authentication similar to this tutorial https://github.com/hasura/learn-graphql/tree/master/tutorials/frontend/nextjs/app-final

I'm able to login successfully and get my auth0 profile with auth0.handleProfile. I get back a user object with https://hasura.io/jwt/claims as one of the keys.

However, when I try to run a graphql query (by navigating to /posts in my case), I get the following error:

error Error: Network error: cannot start as connection_init failed with : claims key: 'https://hasura.io/jwt/claims' not found
    at new ApolloError (bundle.esm.js?74ca:63)

So it seems like my claim isn't being added. I know I have the rule setup on auth0 to add the claim. And I see the claim in the user object when calling auth0.handleProfile.

I'm not sure what I'm doing wrong.

Here's the repo: https://github.com/tonyjmartinez/from-way-downtown-next

@tonyjmartinez try to check your auth0 rules, it was happening with me but I saw it was a typo in this section:
https://hasura.io/learn/graphql/nexatjs-fullstack-serverless/auth0-setup/1-custom-claims/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anisjonischkeit picture anisjonischkeit  路  3Comments

marionschleifer picture marionschleifer  路  3Comments

leoalves picture leoalves  路  3Comments

bogdansoare picture bogdansoare  路  3Comments

egislook picture egislook  路  3Comments