# How large can custom claims be for IdToken?

**URL:** <https://community.auth0.com/t/how-large-can-custom-claims-be-for-idtoken/63376>\
**Category:** Get Help\
**Tags:** permissions, roles, login, auth0\
**Created:** [May 25, 2021, 11:28pm UTC](https://community.auth0.com/t/how-large-can-custom-claims-be-for-idtoken/63376 "2021-05-25T23:28:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammadz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mohammadz/32/13482_2.png) [@mohammadz](https://community.auth0.com/u/mohammadz)\
**Post date:** [May 25, 2021, 11:28pm UTC](https://community.auth0.com/t/how-large-can-custom-claims-be-for-idtoken/63376/1 "2021-05-25T23:28:09Z")

</div>

Hi,

A quick question,

What is the maximum size limit for adding a custom claim to an idToken? I’m debating whether I should use roles and permissions via the custom claims and IdToken. Or just use the management API via an express app. I know I’ll be limited via the rate limit for the management API and I don’t expect to hit that rate limit consistently.

Just curious about the possibilities that I have, any suggestions are welcome.

Thanks,  
@mohammadz

---

<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:** [May 26, 2021, 11:08am UTC](https://community.auth0.com/t/how-large-can-custom-claims-be-for-idtoken/63376/3 "2021-05-26T11:08:04Z")

</div>

Hey there!

Not sure, but let me check that for you!

---

<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:** [May 26, 2021, 11:21am UTC](https://community.auth0.com/t/how-large-can-custom-claims-be-for-idtoken/63376/4 "2021-05-26T11:21:29Z")

</div>

In our official docs there is no information about the limit:

> **[JSON Web Token Claims](https://auth0.com/docs/secure/tokens/json-web-tokens/json-web-token-claims)**
>
> Describe JSON web token (JWT) claims and how they are used in Auth0.

but I also found this one:

> <https://stackoverflow.com/questions/26033983/what-is-the-maximum-size-of-jwt-token>

which might be helpful.

---

<div class="post-metadata">

**Author:** ![mohammadz](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/mohammadz/32/13482_2.png) [@mohammadz](https://community.auth0.com/u/mohammadz)\
**Post date:** [May 27, 2021, 12:55am UTC](https://community.auth0.com/t/how-large-can-custom-claims-be-for-idtoken/63376/5 "2021-05-27T00:55:22Z")

</div>

Hi @konrad.sopala,

Thanks for the answer. As noted by one of the stackoverflow answers people have mentioned 8k for HTTP headers size limit, which makes sense. Ok I’ll start off with the putting the roles and permission in the idToken via a rule. If it goes wild then I’ll consider using a backend server to make calls to get roles and permissions for a user.

---

<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:** [May 27, 2021, 11:06am UTC](https://community.auth0.com/t/how-large-can-custom-claims-be-for-idtoken/63376/6 "2021-05-27T11:06:25Z")

</div>

Sure! Makes sense! Let us know if you have any other questions down the road!

---

<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:** [May 27, 2021, 11:09am UTC](https://community.auth0.com/t/how-large-can-custom-claims-be-for-idtoken/63376/7 "2021-05-27T11:09:11Z")

</div>


