You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use claims_map to map x-hasura-allowed-roles, x-hasura-default-role and x-hasura-user-id fields from the casdoor token fields. Here is our value for HASURA_GRAPHQL_JWT_SECRET environment variable.
We have a problem on the x-hasura-allowed-roles field, the error from Hasura is : 'JWT claim does not contain "x-hasura-allowed-roles.
we verify the token sent to Hasura and we have 2 role objects in the roles array (with name field)
all the authentication works well when we define a default value for x-hasura-allowed-roles in the claims_map
I guess problem come from the JSON path $.roles[\"*\"].name, we try different solution :
"$.roles[*].name", error at startup : Fatal Error:- Environment variable HASURA_GRAPHQL_JWT_SECRET: Error in $['claims_map']: $.roles[*].name. Accept letters, digits, underscore (_) or hyphen (-) only. Use quotes enclosed in bracket (["..."]) if there is any special character
"$.roles['*'].name", same error : 'JWT claim does not contain "x-hasura-allowed-roles
What is the expected behaviour?
x-hasura-allowed-roles field contains an array of role name's provided by the casdoor token.
Version Information
Server Version: 2.43.0
Environment
Self hosted with docker-compose (docker tag
hasura/graphql-engine:v2.43.0
).Context
We use Hasura with Casdoor, we follow this 2 docs :
We use
claims_map
to mapx-hasura-allowed-roles
,x-hasura-default-role
andx-hasura-user-id
fields from the casdoor token fields. Here is our value forHASURA_GRAPHQL_JWT_SECRET
environment variable.What is the current behaviour?
We have a problem on the
x-hasura-allowed-roles
field, the error from Hasura is :'JWT claim does not contain "x-hasura-allowed-roles
.roles
array (withname
field)x-hasura-allowed-roles
in theclaims_map
I guess problem come from the JSON path
$.roles[\"*\"].name
, we try different solution :"$.roles[*].name"
, error at startup :Fatal Error:- Environment variable HASURA_GRAPHQL_JWT_SECRET: Error in $['claims_map']: $.roles[*].name. Accept letters, digits, underscore (_) or hyphen (-) only. Use quotes enclosed in bracket (["..."]) if there is any special character
"$.roles['*'].name"
, same error :'JWT claim does not contain "x-hasura-allowed-roles
What is the expected behaviour?
x-hasura-allowed-roles
field contains an array of role name's provided by the casdoor token.How to reproduce the issue?
hasura/graphql-engine:v2.43.0
in the docker-compose file- HASURA_GRAPHQL_JWT_SECRET={"claims_map":{"x-hasura-allowed-roles":{"path":"$$.roles[\"*\"].name"},"x-hasura-default-role":{"path":"$$.roles[0].name"},"x-hasura-user-id":{"path":"$$.id"}},"jwk_url":"https://casdoor.d2d.sncf.fr/.well-known/jwks"}
The text was updated successfully, but these errors were encountered: