# JWT Custom claim not added to accessToken with either authentication rule or action

**URL:** <https://community.auth0.com/t/jwt-custom-claim-not-added-to-accesstoken-with-either-authentication-rule-or-action/87596>\
**Category:** Get Help\
**Tags:** jwt, auth0\
**Created:** [July 25, 2022, 3:09pm UTC](https://community.auth0.com/t/jwt-custom-claim-not-added-to-accesstoken-with-either-authentication-rule-or-action/87596 "2022-07-25T15:09:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pbmangan](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/pbmangan/32/38965_2.png) [@Pbmangan](https://community.auth0.com/u/Pbmangan)\
**Post date:** [July 25, 2022, 3:09pm UTC](https://community.auth0.com/t/jwt-custom-claim-not-added-to-accesstoken-with-either-authentication-rule-or-action/87596/1 "2022-07-25T15:09:27Z")

</div>

I am trying to add custom claim to connect to Hasura. I have been stuck on properly configuring the jwt to include the hasura role and unable to add anything to it. I am using [jwt.io](http://jwt.io) to test and have tried the exact recommended config with both the action and rules approach.

---

<div class="post-metadata">

**Author:** ![josiah\_devizia](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/josiah_devizia/32/33352_2.png) [@josiah\_devizia](https://community.auth0.com/u/josiah_devizia)\
**Post date:** [July 25, 2022, 4:08pm UTC](https://community.auth0.com/t/jwt-custom-claim-not-added-to-accesstoken-with-either-authentication-rule-or-action/87596/2 "2022-07-25T16:08:33Z")

</div>

I ran into a similar issue at one point. The issue in my case was I did not add a namespace to my custom claim. Auth0 requires that custom claims have a namespace to avoid collisions with their claims or OIDC/OAuth defined standard claims.

So instead of `claim_name`, you would have to do `https://yourapplication.com/claim_name`.

---

<div class="post-metadata">

**Author:** ![josiah\_devizia](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/josiah_devizia/32/33352_2.png) [@josiah\_devizia](https://community.auth0.com/u/josiah_devizia)\
**Post date:** [July 29, 2022, 11:13am UTC](https://community.auth0.com/t/jwt-custom-claim-not-added-to-accesstoken-with-either-authentication-rule-or-action/87596/3 "2022-07-29T11:13:17Z")

</div>

UPDATE:  
The requirement to namespace claims has just been removed. It is still recommended, but not enforced.  
See the following documentation.

> **[Custom Claims Migration](https://auth0.com/docs/troubleshoot/product-lifecycle/deprecations-and-migrations/custom-claims-migration)**
>
> Describes migration from Legacy namespaced claims to custom claims.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [July 29, 2022, 11:51am UTC](https://community.auth0.com/t/jwt-custom-claim-not-added-to-accesstoken-with-either-authentication-rule-or-action/87596/4 "2022-07-29T11:51:13Z")

</div>

Thanks for sharing that with the rest of community!

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [November 4, 2022, 1:22pm UTC](https://community.auth0.com/t/jwt-custom-claim-not-added-to-accesstoken-with-either-authentication-rule-or-action/87596/5 "2022-11-04T13:22:40Z")

</div>


