# Unique ID for Users

**URL:** <https://community.auth0.com/t/unique-id-for-users/53139>\
**Category:** Get Help\
**Created:** [November 12, 2020, 2:49pm UTC](https://community.auth0.com/t/unique-id-for-users/53139 "2020-11-12T14:49:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![alej.canizales](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alej.canizales/32/25571_2.png) [@alej.canizales](https://community.auth0.com/u/alej.canizales)\
**Post date:** [November 12, 2020, 2:49pm UTC](https://community.auth0.com/t/unique-id-for-users/53139/1 "2020-11-12T14:49:18Z")

</div>

New to Auth0. Liking it so far.

I have a python flask backend which formerly used a DB table with Users. But now I’m trying to set up Auth0.

How do I create a table or mechanism to identify users with a unique ID?

Can I get a unique ID directly from auth0 in the front end?

Or is there a a way to pull this from the backend?

const { user } = useAuth0() gives me the following. But nothing here is both permanent and unique since user emails do changes.

user = {  
email: “john.b.smith@gmail.com”  
email\_verified: true  
family\_name: “Smith”  
given\_name: “John”  
locale: “en”  
name: “John Smith”  
nickname: “john.b.smith”  
picture: “[https://lh3.googleusercontent.com/a-/AOh14dfrtyuRTYHfYOPGZrL641HkQoNqd=s96-c”](https://lh3.googleusercontent.com/a-/AOh14dfrtyuRTYHfYOPGZrL641HkQoNqd=s96-c%E2%80%9D)  
sub: “google-oauth2|113456789076”  
updated\_at: “2020-11-12T14:40:20.297Z”  
}

Thanks.

---

<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:** [November 12, 2020, 8:13pm UTC](https://community.auth0.com/t/unique-id-for-users/53139/3 "2020-11-12T20:13:17Z")

</div>

Hi @alej.canizales,

Welcome to the Community!

You can use the sub claim as the user identifier. This value is the Auth0 user\_id you see in the dashboard.

Hope this helps,  
Dan

---

<div class="post-metadata">

**Author:** ![alej.canizales](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alej.canizales/32/25571_2.png) [@alej.canizales](https://community.auth0.com/u/alej.canizales)\
**Post date:** [November 12, 2020, 11:05pm UTC](https://community.auth0.com/t/unique-id-for-users/53139/4 "2020-11-12T23:05:30Z")

</div>

Hi Dan. Thank you.

Is there a way my back end can pull a users table directly for Auth0, without having to consult the front end for any tokens? Of course, this would have to be updated frequently but it might be useful.

---

<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:** [November 12, 2020, 11:43pm UTC](https://community.auth0.com/t/unique-id-for-users/53139/5 "2020-11-12T23:43:57Z")

</div>

@alej.canizales,

Can you elaborate on this? What are you pulling from the user and what info are you adding to your backend? You can use the management API to make changes to your users in auth0, including reading their data, but you might not need to do this constantly if you can avoid it.

---

<div class="post-metadata">

**Author:** ![alej.canizales](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/alej.canizales/32/25571_2.png) [@alej.canizales](https://community.auth0.com/u/alej.canizales)\
**Post date:** [November 13, 2020, 12:41am UTC](https://community.auth0.com/t/unique-id-for-users/53139/6 "2020-11-13T00:41:41Z")

</div>

I’m thinking of pulling all my users data, like that json, into a table. Each json is a row, every property a column.

---

<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:** [November 13, 2020, 4:19pm UTC](https://community.auth0.com/t/unique-id-for-users/53139/7 "2020-11-13T16:19:33Z")

</div>

I see. You can also create a row with the data when the user is created, and update if the id token does not match the table when a new id token is issued, this will save you extra calls as you will already be requesting an id token for the application.

---

<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 28, 2020, 4:19pm UTC](https://community.auth0.com/t/unique-id-for-users/53139/8 "2020-11-28T16:19:44Z")

</div>

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