Hello everyone,
I have a java class for simple ldap authentication (true or false).
Premise that, obviously, username and password are correct, the server address is correct, I have tried solutions practically anywhere.
The code is:

Code:
public class jcInterrogaLDAP {

    public boolean InterrogaLDAP(String usr, String psw) {
        boolean blLdapVerify = false;
        Properties env = new Properties();
        env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
        env.put(Context.PROVIDER_URL, "ldap://atmdc03:389");
        env.put(Context.SECURITY_AUTHENTICATION, "simple");
        env.put(Context.SECURITY_PRINCIPAL, "cn=" + usr + ",conn");
        env.put(Context.SECURITY_CREDENTIALS, psw);
        try {
            DirContext authContext = new InitialDirContext(env);
            // Authentication OK
            blLdapVerify = true;
            authContext.close();
        } catch (AuthenticationException authEx) {
            authEx.getMessage();
            // Authentication failed
            blLdapVerify = false;
        } catch (NamingException namEx) {
            namEx.getMessage();
            // Something went wrong 
            blLdapVerify = false;
        }
        return blLdapVerify;
    }
}
The error message is:

Code:
javax.naming.AuthenticationException: [LDAP: error code 49 - 80090308: LdapErr: DSID-0C09030B, comment: AcceptSecurityContext error, data 525, v893]
Someone sees a mistake?
Thanks
Massimo