title: LDAP authentication with Jetty
body: <p>I am trying to setup a LDAP based authentication with Jaas on Jetty.</p>
  
  <p>I've first configured <code>Jetty-&gt;Jass</code> trying with a property file login module, then when this done i am changing to Ldap based login module ... but i have a weird problem:</p>
  
  <p>I have this configuration</p>
  
  <pre><code>jettyLogin {
     org.eclipse.jetty.plus.jaas.spi.LdapLoginModule required
      debug="true"
      contextFactory="com.sun.jndi.ldap.LdapCtxFactory"
      hostname="localhost"
      port="1389"
      bindDn="uid=admin,ou=People,o=acme,dc=example,dc=com"
      bindPassword="admin"
      authenticationMethod="simple"
      forceBindingLogin="false"
      userBaseDn="ou=People,o=acme,dc=example,dc=com"
      userRdnAttribute="uid"
      userIdAttribute="uid"
      userPasswordAttribute="userPassword"
      userObjectClass="inetOrgPerson"
      roleBaseDn="ou=Roles,o=acme,dc=example,dc=com"
      roleNameAttribute="cn"
      roleMemberAttribute="member"
      roleObjectClass="groupOfNames";
     };
  </code></pre>
  
  <p>for a LDAP entry like this</p>
  
  <pre><code>dn: uid=jduke,ou=People,o=acme,dc=example,dc=com
  objectclass: top
  objectclass: inetOrgPerson
  objectclass: person
  uid: jduke
  cn: Java
  sn: Duke
  userPassword: theduke
  mail: jduke@acme.example.com
  </code></pre>
  
  <p>What i see is that <code>LdapLoginModule</code> is called and searchs for the user; the user is found but when attributes are retrieves userPassword attribute is missing (!!) ... then it stays null and authentication fails.</p>
  
  <p>I cannot understand why <code>userPassword</code> attribute is not retrieved.</p>