<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">I guess you changed just "Username LDAP
attribute" but you didn't change the username mapper? See
"mappers" tab under ldap federation provider.<br>
<br>
When you create new LDAP federation provider, there are some set
of default LDAP mappers automatically created. There is best
effort to create set of mappers based on the initial configuration
you provided. But once you later update the configuration, the
mappers are not updated anymore (because it's chance you already
did some changes to mapper configuration in the meantime). <br>
<br>
If you can't figure mapper configuration, you can try to create
federationProvider from the scratch with the "sAMAccountName" from
the start.<br>
<br>
Hope it helps,<br>
Marek<br>
<br>
On 17/02/16 12:37, Porfyrios Vasileiou wrote:<br>
</div>
<blockquote
cite="mid:CAHa5F_u1Nfxs8eXVq=7_xS7cowjV8=Gy1MshjkmKFzTjk6XWsw@mail.gmail.com"
type="cite">
<div dir="ltr">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>
<br>
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>
<br>
<div>13:31:53,899 ERROR
[org.keycloak.federation.ldap.LDAPFederationProviderFactory]
(default task-25) Failed during import user from LDAP: <a
moz-do-not-send="true" href="http://org.keycloak.mo">org.keycloak.mo</a></div>
<div>dels.ModelException: User returned from LDAP has null
username! Check configuration of your LDAP mappings. Mapped
username LDAP attribute: cn, user DN</div>
<div>: CN=internal2 lastname,OU=DTPH,DC=dls,DC=lan, attributes
from LDAP: {whenChanged=[20160217110433.0Z],
whenCreated=[20160217110433.0Z], sAMAccountName</div>
<div>=[internal2], givenName=[internal2], sn=[lastname],
userAccountControl=[512], pwdLastSet=[131001806735067575]}<br>
<br>
If u put it back to cn it works, but i want to use
sAMAccountName for the username.<br>
<br>
Why does this happen ?</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
keycloak-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-user">https://lists.jboss.org/mailman/listinfo/keycloak-user</a></pre>
</blockquote>
<br>
</body>
</html>