We are using following setup:
- Universal Login
- Authentication Profile: Identifier + Password
- Configured type of users as “Both” (Users may sign up with a personal account and be affiliated with one or more organisations.)
- No Prompt for org selection
- We don’t want to display any prompt for organisation selection as one user belongs to one organisation only
We are currently handling this with the following approach:
- Log in without specifying an organization using
loginWithRedirect()
. - Retrieve the access token and get the organization list using
getAccessTokenSilently
and the Management API. - Log in again with the first organization from the list using
loginWithRedirect({ organization: orgList[0].id })
.
However, this solution introduces significant latency into the login flow.
We also attempted to set the organization context through actions by including the org_id
in the token claims, but Auth0 does not permit this as it is a restricted claim.
What is the recommended way to automatically select organisation during login as one user belongs to one organisation only?