Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get custom attribute from LDAP and map into keycloak

we are using synchronize function to get all users from LDAP into keycloak. I want to get custom attribute "User logon name" which is available in LDAP. mapper setting which is already done is getting username, first name, last name, mail. how do i change mapper setting to get "User logon name" from LDAP and save it into username field of keycloak.? i have performed following steps but no luck:

  1. changed mapper "LDAP attribute = "User logon name"
  2. synchronize all users

any guideline would be appreciated.

like image 640
veer kumar rathore Avatar asked Jan 30 '26 19:01

veer kumar rathore


1 Answers

From what I understand you want to map a field called "User logon name" from LDAP into a field called username in Keycloak. Try the following:

  • Go to Realm where the LDAP is configured;
  • Go to User Federation;
  • Select the LDAP in question;
  • In the Setting tab set the field "Username LDAP Attribute" to "User logon name";
  • Click [Save];
  • The switch the tab to Mappers;
  • Select username;
  • edit "LDAP Attribute" to "User logon name"
  • Click [Save]; and tried it out.
like image 88
dreamcrash Avatar answered Feb 03 '26 04:02

dreamcrash



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!