# Custom Claims in Token

**URL:** <https://community.auth0.com/t/custom-claims-in-token/12095>\
**Category:** JWT.io\
**Tags:** auth0\
**Created:** [June 4, 2018, 7:31pm UTC](https://community.auth0.com/t/custom-claims-in-token/12095 "2018-06-04T19:31:49Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![neil2](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@neil2](https://community.auth0.com/u/neil2)\
**Post date:** [June 4, 2018, 7:31pm UTC](https://community.auth0.com/t/custom-claims-in-token/12095/1 "2018-06-04T19:31:49Z")

</div>

Hello, When a Jwt token is generated I would like to include some custom user claims that only exist in my user database. Is this possible or do all claims need to exist as pre-defined attributes in Auth0.

I have my own user database because there are some dynamic and complicated user permissions that I need to store there. I realize that one option is not to store these permissions in the token and I could have a separate api to get them but for performance and simplicity I’d rather wrap them into the Jwt token. I can’t seem to see a way to do this.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![luis.rudge](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/luis.rudge/32/7073_2.png) [@luis.rudge](https://community.auth0.com/u/luis.rudge)\
**Post date:** [June 5, 2018, 12:42am UTC](https://community.auth0.com/t/custom-claims-in-token/12095/2 "2018-06-05T00:42:47Z")

</div>

You can do that using a rule. More on this here: [OpenID Connect Scopes](https://auth0.com/docs/api-auth/tutorials/adoption/scope-custom-claims#custom-claims)

---

<div class="post-metadata">

**Author:** ![neil2](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@neil2](https://community.auth0.com/u/neil2)\
**Post date:** [June 5, 2018, 7:01am UTC](https://community.auth0.com/t/custom-claims-in-token/12095/3 "2018-06-05T07:01:30Z")

</div>

Thanks for the reply. Are you suggesting that the rule could call a rest api in my application to get the custom data. If that’s possible I’m not sure how I would secure that api call. Do you have an example anywhere? Thanks again

---

<div class="post-metadata">

**Author:** ![luis.rudge](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/luis.rudge/32/7073_2.png) [@luis.rudge](https://community.auth0.com/u/luis.rudge)\
**Post date:** [June 6, 2018, 5:17pm UTC](https://community.auth0.com/t/custom-claims-in-token/12095/4 "2018-06-06T17:17:15Z")

</div>

Yes, you can do that in a rule. How you’ll secure that call it’s up to you. Use a secret token/use the current transaction state etc.

---

<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:** [December 17, 2018, 11:09am UTC](https://community.auth0.com/t/custom-claims-in-token/12095/5 "2018-12-17T11:09:15Z")

</div>


