Ready to post? First, try searching for your answer.
Hi I just started trying to set up Auth0 instead of AWS Cognito for a project as Cognito was very cumbersome I found.
I was wondering if its possible to have new user signups automatically go to my external MongoDB while also having them stored in the Auth0 DB too at the same time? Im guessing its possible by calling one of the management APIs and passing the user object data to my DB after a new sign up on the client side, but I was wondering if it was possible to have this happen automatically via the dashboard, my understanding was that as regards the dashboard management of user data db stores I had to choose either between using the built in Auth0 DB or my own custom one and not both? I hope my question makes sense, Im still new at this so apologies, thanks very much.
The common scenario is that users are authenticated against the external database credentials and during the first (after integrating with Auth0) login, being migrated to the Auth0 hosted user pool (called here Username-Password-Authentication).
The process is called Lazy migration and is described here - please take a look and let us know if you have further questions
Thanks so much for the reply @marcelina.barycka . So after a login attempt auth0 checks against my external db first and if the user is not there it will create a new user in both the internal and external db? I hope i have it correct, thanks. My circumstance is that I have no users at present but each time one is created i need to it be in auth0s db and my mongoDB if that makes sense. I was hoping after a signup the user data would propagate to MongoDB from Auth0 or vice versa.
If the user is present in your MongoDB and not in Auth0, it will be created in Auth0 during login. But the lazy migration doesn’t work the other way around.
If you need to maintain both user pools, you can periodically export the list from Auth0 and import it to the external database. For this purpose, you can use our Management API. Here is a doc on that.
Thanks for the reply @marcelina.barycka , I think i’m a bit confused. I have my react app running with the Auth0 login and signup UI working. When I sign up via this UI i see a new user being created in the Auth0 dashboard users section (for my Username-Password-Authentication DB). I would like these new users to also be added to my mongodb database. Id like the react UI to add the user to both databases. Should I set the react app to call the create user action for a custom db that i create on auth0 after a sign up via to the UI to add the new user to the mongodb. Or can i get the Username-Password-Authentication DB thats created on tenant creation to send the user data to mongo db when a user is created??
I hope this makes sense, is there a normal procedure that most people follow to achieve what im looking for? Would creating a flow on teh dashboard achieve this ?
Thanks very much for the help, I really appreciate it.
I should also say that this only works for people signing in without using social sign in with Google or another provider. In that case the user only gets added to the Auth0 DB