Allow one auth0 user to login to second auth0 user seamlessly and within same app

I have a scenario where a user has multiple logins within the same environment. Each one represents a different organization and has different email addresses/passwords associated. They want the ability to switch from one to the other without having to first logout and login again. They are connected to the same app as well.

I know I can implement this using custom app/logic along with API. The problem is storing the information to the 2nd account in the app database to create the “bridge”

Is there a better mechanism within Auth0 to achieve this leveraging some kind of approval token or link between the two Auth0 accounts that would allow this use case?

Not looking for SSO, reusing the same email, etc. I get all those, so please don’t recommend a different use case. Just looking to see if there is an easier, and more secure, mechanism available to achieve this specific use case.

Use Case description:

User A, App A
User B, App A

User A logged in and wants to switch to his User B account without having to enter the User B credentials every time.

Option 1:

  • store User B login credentials in DB in encrypted manner and leverage Auth0 API to log out user A and login as User B.

Option 2:

  • ?

TIA

Hi @dmitry

This is an odd use case. I do not recommend any approach like what you are asking.

Giving a user A access to user B’s account with asking for credentials is a huge security risk. You may be able to come up with a solution/protocol that achieves this, but you should have an in-depth security review.

If user A and user B are truly the same user, you can link the two accounts, but this isn’t quite what you are asking.

I’d suggest reviewing your architecture to come up with an approach that is more easy to secure.

John