# JWT sub field: is its second section globally unique?

**URL:** <https://community.auth0.com/t/jwt-sub-field-is-its-second-section-globally-unique/72057>\
**Category:** Get Help\
**Created:** [October 26, 2021, 9:01am UTC](https://community.auth0.com/t/jwt-sub-field-is-its-second-section-globally-unique/72057 "2021-10-26T09:01:56Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![michele.patrassi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michele.patrassi/32/32596_2.png) [@michele.patrassi](https://community.auth0.com/u/michele.patrassi)\
**Post date:** [October 26, 2021, 9:01am UTC](https://community.auth0.com/t/jwt-sub-field-is-its-second-section-globally-unique/72057/1 "2021-10-26T09:01:56Z")

</div>

Hey there!

I noticed the **sub** part of the [JWT](https://auth0.com/docs/security/tokens#id-tokens) has always this format: PROVIDER\_NAME | RANDOM\_NUMBER (e.g. auth0|123456).

Is RANDOM\_NUMBER globally unique between providers? Or could happen that two different providers have the same RANDOM\_NUMBER?

A bit of background: I’m storing the sub in another system, but was thinking of stripping out the PROVIDER\_NAME to expose as less information as possible. Don’t like the idea of someone taking the other system and knowing how many people used google to authenticate for example.

Thanks!

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [October 26, 2021, 1:12pm UTC](https://community.auth0.com/t/jwt-sub-field-is-its-second-section-globally-unique/72057/2 "2021-10-26T13:12:14Z")

</div>

Hi @michele.patrassi

Whie it is extremely unlikely, the RANDOM\_NUMBER part could be duplicated between providers.

John

---

<div class="post-metadata">

**Author:** ![michele.patrassi](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/michele.patrassi/32/32596_2.png) [@michele.patrassi](https://community.auth0.com/u/michele.patrassi)\
**Post date:** [October 26, 2021, 1:52pm UTC](https://community.auth0.com/t/jwt-sub-field-is-its-second-section-globally-unique/72057/3 "2021-10-26T13:52:39Z")

</div>

thanks @john.gateley!

Based on that, do you see any security risk in making the Auth0 id public? If someone knows my Auth0 id, does it matter?

---

<div class="post-metadata">

**Author:** ![john.gateley](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/john.gateley/32/10879_2.png) [@john.gateley](https://community.auth0.com/u/john.gateley)\
**Post date:** [October 27, 2021, 1:17pm UTC](https://community.auth0.com/t/jwt-sub-field-is-its-second-section-globally-unique/72057/4 "2021-10-27T13:17:08Z")

</div>

Hi @michele.patrassi

There is no obvious security risk, but it depends on what you can do with that id.

In the US, if you have my social security number, plus a couple of other bits of information about me, you can open a credit card in my name.

Take a look at your app and see if there is any similar path - anywhere a user in possession of the ID could do something.

John

---

<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:** [November 11, 2021, 1:17pm UTC](https://community.auth0.com/t/jwt-sub-field-is-its-second-section-globally-unique/72057/5 "2021-11-11T13:17:49Z")

</div>

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