Multiple Database connection with single application

Hey guys ,
Suppose I have two applications

  1. Internal Portal
  2. Public Portal

with database connections like

  1. Internal DB
  2. Public DB

and I want to access Internal DB and Public DB while login through Public Portal to check for user.
And there isn’t any specified domain in email id for the Public DB

so the User of Internal DB can login in Internal Portal and Public Portal both whereas User of Public DB can only login to Public Portal.

Hi @bgandhi39

A couple of things you can try:

  • You can have two Public Portal apps, one is for the Public DB, and one is for the Internal DB. Internal users would be the only ones with access to the internal DB app
  • You can have two login buttons in your Public Portal: one for public users, one for internal users.

John

1 Like

Hey @bgandhi39, hey @john.gateley,

I currently have a similar problem, but only with one Application but also with two (custom) database connections.

What I want to approach is, that a user which exists in DB1 and/or DB2 can login.
What’s working, when the user isn’t migrated to Auth0 yet and logs in with his credentials valid for DB1.
But in the case the user isn’t migrated to Auth0 yet and the user trys to login with his credentials (same email address, but different password) not valid for DB1, but only for DB2 it isn’t working and an error appears.

Also in this context, would it be possible to login the user, when the user is already migrated (with his credentials from DB1), but trys to login with the credentials valid in DB2?
With Account Linking Extension in the works…

@bgandhi39: which solution did you choose at the end for your case?

@john.gateley while I appreciate the response, those solutions are not what we are expecting in these situations!! :sweat_smile:… I’m in a similar situation. Have APP A and APP B where user can log in through NEW universal login. They click on a link to APP C which is a NextJS application using the Auth0 NextJs sdk. It would be great if I could use the standard configuration for my APP C as stated in the docs and receive something like a query parameter, through an API route on the server side to modify which database connection the authorize endpoint would attempt to check the session for. I have tried in the dynamic next auth route to extend the authenticationParameters to include “connection” : “name-of-db”. This doesn’t seem to work… any advice??