# How to add custom claim

**URL:** <https://community.auth0.com/t/how-to-add-custom-claim/68800>\
**Category:** Get Help\
**Created:** [August 30, 2021, 2:38pm UTC](https://community.auth0.com/t/how-to-add-custom-claim/68800 "2021-08-30T14:38:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stefdelec](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/stefdelec/32/31055_2.png) [@stefdelec](https://community.auth0.com/u/stefdelec)\
**Post date:** [August 30, 2021, 2:38pm UTC](https://community.auth0.com/t/how-to-add-custom-claim/68800/1 "2021-08-30T14:38:03Z")

</div>

How to add custom claim:  
For example in the doc there is not namespacing claims:  
{  
“sub”: “1234567890”,  
“name”: “John Doe”,  
“admin”: true  
}

But in the doc it is written:

By default, Auth0 always enforces namespacing; any custom claims with non-namespaced identifiers will be silently excluded from tokens and silently ignored in Actions and Rules.

What does “by default” mean? Is there anything where i can specify it?

Stéphane

---

<div class="post-metadata">

**Author:** ![sgo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sgo/32/13789_2.png) [@sgo](https://community.auth0.com/u/sgo)\
**Post date:** [August 31, 2021, 3:01pm UTC](https://community.auth0.com/t/how-to-add-custom-claim/68800/2 "2021-08-31T15:01:07Z")

</div>

Hi @stefdelec ,

Custom namespacing is enforced for any additional custom claims you wish to add to tokens, i.e. ones you add via [Rules](https://auth0.com/docs/configure/apis/scopes/sample-use-cases-scopes-and-claims#add-custom-claims-to-a-token) or [Actions](https://auth0.com/docs/actions/triggers/post-login#add-user-roles-to-tokens).

There isn’t a way to modify this behaviour I’m afraid, anything not returned in the standard tokens you can fetch via [standard scopes](https://auth0.com/docs/configure/apis/scopes/openid-connect-scopes#standard-claims) would need to be added with a custom namespace via a rule or action.

Please let me know if you have any further queries on this

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 15, 2021, 3:01pm UTC](https://community.auth0.com/t/how-to-add-custom-claim/68800/3 "2021-09-15T15:01:37Z")

</div>

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