Skip to content

Commit 15a81a1

Browse files
chore: link to the config to flatten custom claims in Hydra (#2250)
* Added a link to the config to flatten custom claims in Hydra, it isn't very obvious that this config exists unless you stumble upon it from somewhere else (like search) * format * code review changes * code review changes Co-authored-by: Vincent <[email protected]> * tweaks * chore: apply suggestions from code review * chore: apply suggestions from code review --------- Co-authored-by: Vincent <[email protected]>
1 parent 7773a88 commit 15a81a1

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

docs/hydra/guides/oauth2-webhooks.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,13 @@ You cannot override the token subject.
210210

211211
:::
212212

213+
### Add custom claims to top level
214+
215+
By default, all custom claims are mirrored under the `ext` claim in the token.
216+
217+
To flatten custom claims directly into the top level token instead of nesting them under `ext`, use the following
218+
[configuration](../../oauth2-oidc/jwt-access-token#adding-custom-claims-to-top-level).
219+
213220
### Refresh token
214221

215222
If a webhook for `refresh_token` grant type fails with a non-graceful result, the refresh flow will fail and the supplied

docs/oauth2-oidc/jwt-access-token.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ Which results in the following access token:
156156
}
157157
```
158158

159+
### Add custom claims to top level
160+
159161
If you want `some_custom_claim` to be added to the top level (instead of a nested level) in the access token, you need to modify
160162
the `/oauth2/allowed_top_level_claims` configuration:
161163

0 commit comments

Comments
 (0)