Patrick Derckx
Patrick Derckx

Reputation: 201

Keycloak same username in multiple federations

I have two user federations in one realm (different active directories). Because both are completely independent, in occurs that the same username is used.

In Microsoft Applications you can use something like "ad1\ttestuser" and "ad2\ttestuser". Is there a way I can configure Keycloak to choose the user federation on login? A solution would be to add a prefix to the username in the mapper but there is no way to do it.

Upvotes: 3

Views: 3337

Answers (1)

dreamcrash
dreamcrash

Reputation: 51433

Is there a way I can configure Keycloak to choose the user federation on login?

You could create a different realm per user federation that you want your users to be able to explicitly authentication against. Then you configure each user federation in its own realm. Finally, you configured those realms to do identity brokering against the original realm.

The login page would look something like:

enter image description here

You can have a look a this answer which describes this setup in more detail.

Upvotes: 3

Related Questions