Hi
I spot a strange behaviour in Apache DS 2M6 (basic configuration, nothing
special).
When I try to bind with the admin account, asking for the
PasswordPolicyControl, it fails to bind.
As soon as I remove the control it works fine.
I don't know if it is a bug or not but I did not find anything in the
specifications about that.
Thanks in advance
M.
Hashtable<String, String> environment = new Hashtable<String,
String>();
environment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
environment.put(Context.PROVIDER_URL, "ldap://localhost:389/");
environment.put(Context.SECURITY_PRINCIPAL, "uid=admin,ou=system");
environment.put(Context.SECURITY_CREDENTIALS, "secret");
environment.put(LdapContext.CONTROL_FACTORIES,
"org.springframework.security.ldap.ppolicy.PasswordPolicyControlFactory");
LdapContext ldapContext = new InitialLdapContext(environment, new
Control[] {new PasswordPolicyControl(false)});
Control[] controls = ldapContext.getResponseControls();
for (int j = 0; controls != null && j < controls.length; j++) {
System.out.println(controls[j]);
}
ldapContext.close();
-----------------------
javax.naming.AuthenticationException: [LDAP: error code 49 -
INVALID_CREDENTIALS: Bind failed: null]