-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Custom claims in access token jwt #1974
Copy link
Copy link
Closed
Labels
featNew feature or request.New feature or request.
Description
Is your feature request related to a problem? Please describe.
At the moment trying to add custom claims at the root of the access token but it ends up being under "ext" e.g.
hydraAdmin
.acceptConsentRequest(challenge, {
session: {
access_token: {
foo: 'bar'
},
},
})
gives
{
"ext": {
"foo": "bar"
}
...
}
I would like
{
"foo": "bar"
...
}
E.g. in hasura the format for an access token jwt should be
{
"sub": "1234567890",
"name": "John Doe",
"admin": true,
"iat": 1516239022,
"https://hasura.io/jwt/claims": {
"x-hasura-allowed-roles": ["editor","user", "mod"],
"x-hasura-default-role": "user",
"x-hasura-user-id": "1234567890",
"x-hasura-org-id": "123",
"x-hasura-custom": "custom-value"
}
}
Describe the solution you'd like
Would like the possibility of adding custom claims to the access token jwt.
Describe alternatives you've considered
Current behaviour is ok, I can configure the claims_namespace_path to be $.ext.hasura or seems like I should consider using webhooks instead
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
featNew feature or request.New feature or request.