Skip to content
Discussion options

You must be logged in to vote

Conditionally mapping a single claim isn't possible.

However, for your particular use case, we can suggest the following configuration:

        {
          "claims_map": {
            "x-hasura-default-role": { "path": "$$.x-hasura-default-role" },
            "x-hasura-allowed-roles": { "path": "$$.x-hasura-allowed-roles" },
            "x-hasura-user-id": { "path": "$$.sub", "default": "" },
            "x-hasura-client-id": { "path": "$$.client_id", "default": "" }
          }
        }

This configuration will allow you to parse auth tokens with or without client_id and sub claims.
When the claims are absent, they would default to empty strings.

To avoid issues in your permissions, you…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@cdgipson
Comment options

Answer selected by cdgipson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants