title: How to find out the right ldap parameters
body: <p>I'm currently working on a small project with Active Directory and some LDAP stuff...
  I try to connect to the LDAP server and it always gives me the same error: </p>
  
  <pre><code>[LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1
  </code></pre>
  
  <p>As much as I know this means that the credentials are wrong, but I'm 100% sure that they're right!
  Could it be that I forgot a parameter?</p>
  
  <pre><code>Hashtable&lt;String, String&gt; env = new Hashtable&lt;String, String&gt;();
  
  env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
  env.put(Context.PROVIDER_URL, "ldap://libertycity.ch:389/dc=libertycity,dc=ch");
  env.put(Context.SECURITY_AUTHENTICATION, "simple");
  env.put(Context.SECURITY_CREDENTIALS, password);
  env.put(Context.SECURITY_PRINCIPAL, "uid=" + username + ",ou=Users");
  env.put("java.naming.ldap.attributes.binary", "objectSID");
  
  DirContext ctx = new InitialDirContext(env);
  </code></pre>
  
  <p>I think my code looks right, or did I miss something? What could be the problem and how can I find that out?</p>