# Add username claim to jwt ID Token

**URL:** <https://devforum.okta.com/t/add-username-claim-to-jwt-id-token/15041>\
**Category:** OAuth/OIDC\
**Tags:** api\
**Created:** [July 7, 2021, 2:18pm UTC](https://devforum.okta.com/t/add-username-claim-to-jwt-id-token/15041 "2021-07-07T14:18:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hekmil](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hekmil](https://devforum.okta.com/u/Hekmil)\
**Post date:** [July 7, 2021, 2:18pm UTC](https://devforum.okta.com/t/add-username-claim-to-jwt-id-token/15041/1 "2021-07-07T14:18:45Z")

</div>

Hi,

I was trying to add a custom claim name “username” but I had an error saying that it’s reserved. So I checked in the documentation and found this : [Reserved claims token hook](https://developer.okta.com/docs/reference/token-hook/#reserved-claims-for-token-hooks)

If this claim already exist how can we display it inside the ID Token, it is a need for an API to have this particular name. Or if you have any other idea feel free.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [July 8, 2021, 5:59pm UTC](https://devforum.okta.com/t/add-username-claim-to-jwt-id-token/15041/2 "2021-07-08T17:59:49Z")

</div>

As you saw, you are unable to modify any of the listed reserved claims when using the token hook, however, just because a claim is included in this list, does not mean you will see it returned in every/any tokens issued. Any claim that you see labelled as reserved is not able to be overridden.

---

<div class="post-metadata">

**Author:** ![Hekmil](https://avatars.discourse-cdn.com/v4/letter/h/e47774/32.png) [@Hekmil](https://devforum.okta.com/u/Hekmil)\
**Post date:** [July 9, 2021, 6:59am UTC](https://devforum.okta.com/t/add-username-claim-to-jwt-id-token/15041/3 "2021-07-09T06:59:42Z")

</div>

Alright so as I’m guessing there is no way to have it displayed in the ID token.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [July 9, 2021, 3:30pm UTC](https://devforum.okta.com/t/add-username-claim-to-jwt-id-token/15041/4 "2021-07-09T15:30:57Z")

</div>

under the claim name ‘username’, regrettably no.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [July 12, 2021, 11:23am UTC](https://devforum.okta.com/t/add-username-claim-to-jwt-id-token/15041/5 "2021-07-12T11:23:34Z")

</div>

Closed on July 12, 2021, 11:23am UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
