<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Hi Porfyrios,
<div class=""><br class="">
</div>
<div class="">Not completely sure but it might be this issue or related to it:</div>
<div class=""><a href="https://issues.jboss.org/browse/KEYCLOAK-2403" class="">https://issues.jboss.org/browse/KEYCLOAK-2403</a></div>
<div class=""><br class="">
</div>
<div class="">?</div>
<div class=""><br class="">
</div>
<div class="">cheers</div>
<div class=""><br class="">
<div>
<blockquote type="cite" class="">
<div class="">On 17 Feb 2016, at 12:37, Porfyrios Vasileiou <<a href="mailto:porfyrios.vasileiou@gmail.com" class="">porfyrios.vasileiou@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">Hello, i created a new ldap federation in the keycloak settings and imported all users. The thing is that the username attribute was mapped to the ldap cn attribute whereas the username in active directory is sAMAccountName. Therefore
i changed the ldapAttribute to that.<br class="">
<br class="">
Now when i go to my ldap settings page and click on "Synchronize" the users fail to update and i am getting this error:<br class="">
<br class="">
<div class="">13:31:53,899 ERROR [org.keycloak.federation.ldap.LDAPFederationProviderFactory] (default task-25) Failed during import user from LDAP:
<a href="http://org.keycloak.mo/" class="">org.keycloak.mo</a></div>
<div class="">dels.ModelException: User returned from LDAP has null username! Check configuration of your LDAP mappings. Mapped username LDAP attribute: cn, user DN</div>
<div class="">: CN=internal2 lastname,OU=DTPH,DC=dls,DC=lan, attributes from LDAP: {whenChanged=[20160217110433.0Z], whenCreated=[20160217110433.0Z], sAMAccountName</div>
<div class="">=[internal2], givenName=[internal2], sn=[lastname], userAccountControl=[512], pwdLastSet=[131001806735067575]}<br class="">
<br class="">
If u put it back to cn it works, but i want to use sAMAccountName for the username.<br class="">
<br class="">
Why does this happen ?</div>
</div>
_______________________________________________<br class="">
keycloak-user mailing list<br class="">
<a href="mailto:keycloak-user@lists.jboss.org" class="">keycloak-user@lists.jboss.org</a><br class="">
https://lists.jboss.org/mailman/listinfo/keycloak-user</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>