LDAP user-attr-mapper to set Keycloak's language for a user?

Hi All,

When I login on the account-console I have the option to select and store the Keycloak’s interface language.
Since that information is already stored in AD / LDAP, I would rather create a user-attribute-ldap-mapper to get the PreferredLanguage attribute and use it as Keycloak’s language for the user.

What would be the correct way to configure a LDAP mapper that convinces Keycloak to use the result as its language for the user?

Of course I will take care that the LDAP attribute contains values suitable to be used by Keycloak (but that’s a different topic :slight_smile: ).

I am using Keycloak 25.0.4 with User federation to Samba-AD (4.20).

Update: I found the solution.

The attribute in keycloak is called local.
Creating a mapper that maps keycloak’s locale to ldap’s PreferredLanguage does the job.