# How is user\_id generated with google-oauth2?

**URL:** <https://community.auth0.com/t/how-is-user-id-generated-with-google-oauth2/44569>\
**Category:** Get Help\
**Created:** [June 12, 2020, 4:46am UTC](https://community.auth0.com/t/how-is-user-id-generated-with-google-oauth2/44569 "2020-06-12T04:46:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![nic.waller](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nic.waller/32/21613_2.png) [@nic.waller](https://community.auth0.com/u/nic.waller)\
**Post date:** [June 12, 2020, 4:46am UTC](https://community.auth0.com/t/how-is-user-id-generated-with-google-oauth2/44569/1 "2020-06-12T04:46:17Z")

</div>

We have Auth0 configured to allow login with Google as a social connection. When people log in, they get a user\_id in the form of `google-oauth2|0011223344556677889900`.

Where does this value come from, or how is it generated? Even when they log into a different Auth0 tenant, they still get the same user\_id… or so I thought.

Until today, I’ve noticed that users with the same gmail address always have exactly the same user\_id values among different Auth0 tenants. But today I came across a case where one user had different user\_id values for the same email address! I think it’s probably related to the fact that the user’s email address changed after the initial account was created, and then _one_ of the Auth0 accounts was deleted and re-created.

Where can I find documentation about this value that lays out exactly what assumptions are safe to make, and under what circumstances the value might change?

---

<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:** [June 12, 2020, 11:14pm UTC](https://community.auth0.com/t/how-is-user-id-generated-with-google-oauth2/44569/3 "2020-06-12T23:14:34Z")

</div>

Hi @nic.waller,

The assumptions you can make are listed here:

> **[Identify Users](https://auth0.com/docs/manage-users/user-accounts/identify-users)**
>
> Learn how to uniquely identify users.

There isn’t much in terms of guidance that we give. It looks like you can assume it will be unique, and you can predict the provider.

---

<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:** [June 15, 2020, 5:11pm UTC](https://community.auth0.com/t/how-is-user-id-generated-with-google-oauth2/44569/5 "2020-06-15T17:11:28Z")

</div>

Hi @nancyhawkins181,

Im not sure I understand what you mean Can you explain?

---

<div class="post-metadata">

**Author:** ![nic.waller](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nic.waller/32/21613_2.png) [@nic.waller](https://community.auth0.com/u/nic.waller)\
**Post date:** [June 15, 2020, 6:28pm UTC](https://community.auth0.com/t/how-is-user-id-generated-with-google-oauth2/44569/6 "2020-06-15T18:28:29Z")

</div>

That page didn’t quite answer my question, so I submitted a [pull request](https://github.com/auth0/docs/pull/9161) to improve that page.

---

<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:** [June 15, 2020, 7:01pm UTC](https://community.auth0.com/t/how-is-user-id-generated-with-google-oauth2/44569/7 "2020-06-15T19:01:01Z")

</div>

Thanks for adding the PR @nic.waller. The docs team will take a look.

---

<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:** [June 29, 2020, 11:01pm UTC](https://community.auth0.com/t/how-is-user-id-generated-with-google-oauth2/44569/8 "2020-06-29T23:01:03Z")

</div>

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