What is the recommend way to automatically select organisation during login?

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:

  1. Log in without specifying an organization using loginWithRedirect().
  2. Retrieve the access token and get the organization list using getAccessTokenSilently and the Management API.
  3. 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?

Hi @ankit4

Welcome to the Auth0 Community!

Thank you for posting your question. Unfortunately, there’s no streamlined flow for upgrading your existing process. The team doesn’t have that (automatic organization picker) right now in plans, but I encourage you to open up a topic in the Feedback category and describe your use case and solution ideas.

Thanks
Dawid