We have a setup where a single user can belong to multiple organizations, and we support social login via an external Identity Provider (IDP) (such as Microsoft). This IDP is shared across all organizations, meaning it is not tied to any specific one.
When a user logs in using the social IDP, we want Keycloak to prompt them to select an organization after the IDP authentication is successful. This is important because their session needs to be associated with a specific organizational context (e.g., for multi-tenancy, permissions, or routing purposes).
However, this organization selection step does not appear after the IDP login completes, and the user is simply logged in without context.
Is it possible to configure Keycloak to trigger an organization selection screen after a user logs in via a social IDP, especially in cases where:
- The same user exists across multiple organizations
- The organization cannot be inferred directly from the IDP identity
If yes, how can this be achieved within Keycloak?
We’ve tried customizing the First Broker Login flow by:
- Duplicating it
- Enabling Automatically Link Existing User
- Adding a custom step for Organization Onboarding
…but this flow still does not show the organization selection screen after login. Are we missing a configuration or step to make this work?