# Using 'sub' as user id

**URL:** <https://community.auth0.com/t/using-sub-as-user-id/58306>\
**Category:** Get Help\
**Tags:** access\_token, custom-claims\
**Created:** [February 22, 2021, 8:41pm UTC](https://community.auth0.com/t/using-sub-as-user-id/58306 "2021-02-22T20:41:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ama](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ama/32/13075_2.png) [@ama](https://community.auth0.com/u/ama)\
**Post date:** [February 22, 2021, 8:41pm UTC](https://community.auth0.com/t/using-sub-as-user-id/58306/1 "2021-02-22T20:41:09Z")

</div>

Hello,  
I am new to Auth0, I have an app that requires a unique user Id for a user to carry out certain tasks.  
I understand that I can create custom claims for the user id. My question is, can I use the ‘sub’ claim as an ID for the user? Is it a bad idea to use the sub claim within the app, store it in the database and use it for that purpose?

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [February 22, 2021, 8:50pm UTC](https://community.auth0.com/t/using-sub-as-user-id/58306/3 "2021-02-22T20:50:15Z")

</div>

Hi @ama,

Welcome to the Community!

You can definitely use sub as your user id.

Hope this helps!

---

<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:** [March 9, 2021, 8:50pm UTC](https://community.auth0.com/t/using-sub-as-user-id/58306/4 "2021-03-09T20:50:21Z")

</div>

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