Auth0 Home Blog Docs

user_id hash on Custom DB

custom-database
user_id
hash

#1

I am moving my users on-premises and was wondering which type of hashing auth0 is using when running on the local DB?


#2

I don’t quite understand your question - what do you mean by when running on the local DB? The Auth0 user_id is simply an internal identifier that consists of a connection name and a unique identifier for the user.


#3

By local DB i mean running the DB inside auth0 and not CustomDB. The ID are hashed on auth0 while on my own database its a simple PK starting from 1…x. I would like to re-create the same hashing behaviour on my PK.


#4

To retain the id from your custom db, you can return that id in the user profile in your custom db scripts, e.g:

 callback(null,   {
        user_id:      user.id // user.id is the PK in my custom db
      });

#5

To retain the id from your custom db, you can return that id in the user profile in your custom db scripts, e.g:

 callback(null,   {
        user_id:      user.id // user.id is the PK in my custom db
      });

#6

Thanks. But this does not explain which type of hashing auth0 is using? I want to implement the same hash function on my CustomDB…


#7