# Should I hash the user identifier for a custom database connection?

**URL:** <https://community.auth0.com/t/should-i-hash-the-user-identifier-for-a-custom-database-connection/6365>\
**Category:** Get Help\
**Tags:** uuid, custom, custom-database, user-creation\
**Created:** [April 26, 2017, 2:50am UTC](https://community.auth0.com/t/should-i-hash-the-user-identifier-for-a-custom-database-connection/6365 "2017-04-26T02:50:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![maziar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@maziar](https://community.auth0.com/u/maziar)\
**Post date:** [April 26, 2017, 2:50am UTC](https://community.auth0.com/t/should-i-hash-the-user-identifier-for-a-custom-database-connection/6365/1 "2017-04-26T02:50:35Z")

</div>

I am moving to a CustomDB, which means i won’t be hashing the user.id as default. This is something Auth0 is doing. Are there any security concerns by not hashing the primary key which is exposed in the token? Or should i apply UUID to the user.id?

---

<div class="post-metadata">

**Author:** ![prashantT](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/prashantt/32/6002_2.png) [@prashantT](https://community.auth0.com/u/prashantT)\
**Post date:** [May 2, 2017, 2:17pm UTC](https://community.auth0.com/t/should-i-hash-the-user-identifier-for-a-custom-database-connection/6365/2 "2017-05-02T14:17:32Z")

</div>

Are you completely migrating away from Auth0, or will you be using a custom database connection through Auth0?

---

<div class="post-metadata">

**Author:** ![maziar](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@maziar](https://community.auth0.com/u/maziar)\
**Post date:** [May 2, 2017, 2:28pm UTC](https://community.auth0.com/t/should-i-hash-the-user-identifier-for-a-custom-database-connection/6365/3 "2017-05-02T14:28:47Z")

</div>

I am using CustomDB, currently i am just utilizing a default UUID on my database column which is doing the job ok.

---

<div class="post-metadata">

**Author:** ![jmangelo](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jmangelo/32/7923_2.png) [@jmangelo](https://community.auth0.com/u/jmangelo)\
**Post date:** [May 9, 2017, 5:10pm UTC](https://community.auth0.com/t/should-i-hash-the-user-identifier-for-a-custom-database-connection/6365/4 "2017-05-09T17:10:12Z")

</div>

It’s not technically need to hash the user identifier coming from a custom database. Only have in mind that the user identifier is exposed to the end-user so you should something that is okay to disclose to the end-user itself; using a UUID is an adequate option in general.

---

<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 2, 2018, 5:53am UTC](https://community.auth0.com/t/should-i-hash-the-user-identifier-for-a-custom-database-connection/6365/5 "2018-03-02T05:53:30Z")

</div>


