Rolwin Crasta
Rolwin Crasta

Reputation: 4339

Issue configuring JWT secret with claims_map in Hasura Docker compose

I am trying to set claims_map in HASURA_GRAPHQL_JWT_SECRET in my docker compose file using the below config

HASURA_GRAPHQL_JWT_SECRET: '{"type":"HS256","key":"***************************","claims_namespace":"p-clamis-allow","claims_map":{"x-hasura-user-id":{"path":"$.user.id"}}}'

I get the following error:

Invalid interpolation format for "environment" option in service "graphql-engine":"{"type":"HS256","key":"*************************","claims_namespace":"p-clamis-allow","claims_map":{"x-hasura-user-id":{"path":"$.user.id"}}}"**

Upvotes: 0

Views: 1865

Answers (2)

Balusamy M
Balusamy M

Reputation: 11

This will work with

export HASURA_GRAPHQL_JWT_SECRET="{ \"type\": \"HS256\", \"key\": \"***************************\",\"claims_namespace\":\"p-claims-allow\"}" 

Upvotes: 1

iamnat
iamnat

Reputation: 4166

Replace $ with $$ and things should work!

HASURA_GRAPHQL_JWT_SECRET: '{"type":"HS256","key":"***************************","claims_namespace":"p-clamis-allow","claims_map":{"x-hasura-user-id":{"path":"$$.user.id"}}}'

Upvotes: 3

Related Questions