I am attempting an auth0 implementation in which auth0 will ultimately replace my legacy database that holds my existing user store. Currently I have a custom database connection set up that allows users with existing credentials in my legacy system to log in successfully. I want to be able to allow users to sign up as well, but I don’t want signups to go into that legacy database because I will be sunsetting it in the near future. What is the correct way to go about doing this?
It seems that if I create an additional database connection for auth0, my Universal Login page ignores that second connection and just uses the legacy connection, but I feel like this isn’t a unique use case. How can I allow users with existing credentials in my legacy system to log in using those credentials while still directing new signups to be dumped into the auth0 user store rather than my legacy app’s back end?
If it is at all relevant, my UI is NextJS 15.2.3 and is using the v4 auth0-nextjs SDK. I also have a custom domain set up for my auth0 tenant as well as a custom form template for the signup form.
Hi @relero90
Thank you for reaching out to us!
As you have two Databases enabled for the application, you should be able to Disable Signups to one of those and only allow users to Sign Up to the second Databse.
You can disallow signups in Authentication > Database > Select the specific database and scroll down in Settings tab to find “Disable Sign Ups"
Let me know if this helped!
Have a great one,
Gerald
Hi Gerald,
When I disable signups for my legacy database it simply removes the option to signup from the Universal Login screen. It’s as if Auth0 can’t see that second database connection. Am I missing something?
Thanks in advance for any help!
Hi @relero90
Thank you for letting me know!
You are correct, this seems to be the expected behavior, as I am getting the same result after reproducing. After researching on the matter, when having multiple Databases enabled for an application, Auth0 will default to the the first one.
To overcome this, you will need to pass the connection
parameter in the /authorize request indicating the name of the connection the user should be logged in against for the signup flow.
I recommend reading through the following Knowledge Article on Associating multiple database connections with 1 app, that contains other resources that should be helpful on this matter.
Let me know if this worked for you!
Gerald
Ah I see. This isn’t a great solution for my use case as it would require me to have some way of differentiating legacy versus new users at the time of login and they’ll all be accessing the application from the same domain.
I think we’ll simply have to migrate our legacy user store to auth0, but I would love to recommend as a feature enhancement that it would be really nice to have the ability to tell Auth0 to check a series of user stores/database connections in sequence and only deny authentication if credentials do not work for any of the defined connections.