directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mathieu Pousse <mathieu.pou...@zenika.com>
Subject PasswordPolicy and admin user
Date Fri, 11 May 2012 13:15:56 GMT
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]

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message