I’m looking for the best way to implement a ‘switch account’ flow for my app. I use the hosted page with custom DB connection. On login I add a claim that represents the account the user should have access to (i.e. https://api.myapp.com/account_id: 12345).
It is possible for users to have multiple accounts and be able to seamlessly switch between them (think tenants on Auth0).
I’ve implemented a rule that will, as part of the auth flow redirect to the app to choose what tenant to log in to, passing back the specific claims to add to the access token. The problem is the switching of accounts once logged in.
I thought that I can send through acr_values (I’ve had a previous implementation not in Auth0 doing it this way) and use that to explicitly pick the account, instead of having the user manually choose. The problem is I either send prompt=none and that does not work, or I do not send that at all and the user is shown the login page again even though they are logged in.
Any thoughts on how I could achieve this? How can I, in essence, update the accessToken with new claims for a logged in user?