Assign different default user groups in Keycloak based on different LDAP user federation

Viewed 777

Question is more advanced than usual.

Imagine you have three users groups in Keycloak: Group_Basic, Group_Client_A, Group_Client_B.

You add two different LDAP user federation setting for "Client A" and "Client B".

You make Group_Basic as your default group.

How to automatically assign Group_Client_A to LDAP users from "Client A", and Group_Client_B group to LDAP users from "Client B" ?

Any ideas are welcome! Thanks!

1 Answers

Basically @Vadim pointed to right thing:

Under created LDAP -> Mappers -> Create ->

Mapper type: hadrcoded-ldap-group-mapper

Group: /Group_Client_A

Did synced user, got default Group_Basic group + hardcoded Group_Client_A.

I assume pointing to different group under different LDAP synchronisation will got another group assigned.

Thanks!

Related