Mappers

Keycloak uses mappers to map the user attributes defined in the Keycloak user model such as username and email to the corresponding user attributes in the LDAP/AD user database. By default, when you saved your settings and created your LDAP/AD provider, the following mappers were created.

The username attribute that you specified in the Username LDAP attribute must match the username attribute defined in the Keycloak mapper for the LDAP/AD user database to connect with Keycloak.

If you change the Username LDAP attribute from the default value cn to userPrincipalName, Keycloak would make the same change in the mapper called username to match.