Keycloak group attribute mapping

Viewed 492

I want to set up a Keycloak instance which provides AAI to several applications. The users and groups will come from multiple sources (e.g. LDAP) so I want to use mappers so that the attributes on the Keycloak side are the same for users with the same properties. For user attributes, one can use a user-attribute-ldap-mapper, and that works like a charm.

My users now are part of groups, and the groups have their own attributes. So for instance I would have in one of my LDAPs:

Group1 
  -- MySpecificAttribute1: value
  -- MySpecificAttribute2: other value
User1:
  -- member of Group1
  -- MyUserAttriute1: vall

What I would like to do is to map the attributes MySpecificAttribute1 to Attribute1 in the Group1 group that has been imported into Keycloak.

Is there a (hopefully easy) way to achieve this?

EDIT I thought it could make sense to specify a bit more what I try to achieve. The thing is we are developing an application that needs to have access to the group information, so answering questions like "give me the list of users who are linked in the contactpoint attribute of all groups". Our current approach is to use the REST API to obtain this data directly from keycloak, and it would not be optimal if we had to implement a translation table for the different sources of information. There may be a way to obtain this information in a different way where we would put the translation somewhere in keycloak, that could be worth investigating too.

0 Answers
Related