authentication - LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1 -
ldap: error code 49 - 80090308: ldaperr: dsid-0c0903a9, comment: acceptsecuritycontext error, data 52e, v1db1
i know "52e" code when username valid, password invalid. using same user name , password in apache studio, able establish connection succesfully ldap.
here java code
string username = "*******"; string password = "********"; string base ="dc=psltestdomain,dc=local"; string dn = "cn=" + username + "," + base; hashtable env = new hashtable(); env.put(context.initial_context_factory,"com.sun.jndi.ldap.ldapctxfactory"); env.put(context.provider_url, "ldap://******"); env.put(context.security_authentication, "simple"); env.put(context.security_principal, dn); env.put(context.security_credentials, password); ldapauthenticationservice ldap = new ldapauthenticationservice(); // ldapcontext ctx; dircontext ctx = null; try { ctx = new initialdircontext(env);
my error on line: ctx = new initialdircontext(env);
i not know causing error.
data 52e - returns when username valid password/credential invalid.
you need
string dn = "cn=" + username + "," + "cn=users," + base;
Comments
Post a Comment