Auth0 Home Blog Docs

How to select which db to use on Login

connections

#1

I have two db connections with auth0: connectionA and connectionB

at some point in my app I want to have a radial button asking the user whether they want to authenticate as an A user or a B user. For particular reasons, i dont want to merge this two database connections.

I am using Auth0 widget to authenticate. My application is connected to both databases in the auth0 page.

How do i choose to which db to authenticate against when the user presses login in my app?


#2

If your radio button asks for the user type before showing Lock, you can then specify the connection when showing Lock as follows:

lock.show({connections: 'YOUR_CONNECTION']});

https://auth0.com/docs/libraries/lock/v10/selecting-the-connection-for-multiple-logins


#3