You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@directory.apache.org by Mathieu Pousse <ma...@zenika.com> on 2012/05/11 15:15:56 UTC

PasswordPolicy and admin user

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]

Re: PasswordPolicy and admin user

Posted by Emmanuel Lécharny <el...@gmail.com>.
Le 5/11/12 3:15 PM, Mathieu Pousse a écrit :
> 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.

What would be good is to provide the BindRequest the server receives.


-- 
Regards,
Cordialement,
Emmanuel Lécharny
www.iktek.com