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

Hi group !

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

You make Group_Basic as your default group.

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

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


I think you should be able to use mappers to achieve this.

depending on your requirement you can either use mapper based on hard coded values or access token claims.

right! just found out myself

Under created LDAP -> Mappers -> Create ->

Mapper type: hadrcoded-ldap-group-mapper
Group: /Group_Client_A