When doing a Users lookup in IAM and using the sAMAccountName L012345, the log shows the following error:
2022-02-16 12:07:01,109 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-2) Uncaught server error: com.fasterxml.jackson.databind.JsonMappingException: User returned from LDAP has null username! Check configuration of your LDAP mappings. Mapped username LDAP attribute: cn, user DN: CN=John Smith,OU=Users,OU=ABC,DC=corp,DC=dc,DC=abc,DC=com, attributes from LDAP: {whenChanged=[20220216004657.0Z], whenCreated=[20150112173439.0Z], mail=[[email protected]], sAMAccountName=[L012345], givenName=[John], sn=[Smith], userAccountControl=[512], pwdLastSet=[132862587512251169]}
All supported DevTest releases and platforms.
N/A
In IAM on the LDAP Settings tab:
Set Username LDAP attribute to a value of sAMAccountName
Set RDN LDAP attribute to sAMAccountName.
On the Mappers Tab:
Set the LDAP Attribute for username to sAMAccountName
Restart IAM and delete the old IAM user record (John Smith as shown in the error)
Check that the lookup for the sAMAccountName L012345 is working correctly.