New to Auth0. Not sure how this integrates with a database?

Hi all, relatively new to backend programming and decided to use Auth0 for my authentication than try to write it from scratch. One thing I’m confused is how exactly does the Auth0 work with my backend that’s connected to my DB.

I’d imagine with a custom written auth system in my node.js backend, each user on signup gets some unique ID. And typically, if I want to pull info from my DB, I query thatunique ID and pull all the items based on that field. I’ve only watched a brief tutorial on Auth0 and the video only showed the success of login and logout. So I’m guessing Auth0 provides some sort of unique ID for a new user signup and login that I can store in my DB?

It would be great if someone who’s done this before give me a very general overview of how the flow works from Auth0 to backend to DB.

Hi @chu08888

I would recommend NOT using your DB, but using Auth0 as the DB. If you go this route, there are tools (bulk migration and lazy migration) that will let you move your users from your current DB to Auth0.

If you still want to use your DB, you’ll need a custom DB script - just create a database connection, but turn on “Use my own DB” on the “Custom Database” tab of the DB connection. You’ll then need to write scripts that connect to your custom DB.

John

1 Like