How to add 'memberOf' attribute to SAML response

Hello community members,

Is there any way we can add the ‘memberOf’ attribute to the SAML response? Users are federated from LDAP server (read-only) mode to the Keycloak server.

Any help on this is much appreciated.

Thank you.

Hello! Did u find a solution for this? I have the same question

This requires two steps:

  1. Go to LDAP Settings → Mappers tab, create a mapper of type user-attribute-ldap-mapper, map the memberOf LDAP attribute to a User Model Attribute of your choice;
  2. Go to your SAML client configuration, add a mapper (by configuration) of type User Attribute, then map the user attribute to SAML attribute.

Depending on you Keycloak version, you might need to define the custom attribute in Realm settings → User Profile.

1 Like