java - Error while use authentication from AD server -


package mypack;  import java.util.*; import javax.naming.*; import javax.naming.directory.*;  public class adcheck {     public static void main(string[] args) {         try {             hashtable env = new hashtable();             env.put(context.initial_context_factory,"com.sun.jndi.ldap.ldapctxfactory");             env.put(context.provider_url,"ldap://myad.com:385");              env.put(context.security_authentication,"digest-md5");              env.put(context.security_principal,"my_user_name");              env.put(context.security_credentials, "my_passwors");               dircontext ctx = new initialdircontext(env);             ctx.close();         } catch(namingexception ne) {             system.out.println("error authenticating user:");             system.out.println(ne.getmessage());             return;         }         system.out.println("ok, authenticating user");     } } 

getting error:

javax.naming.authenticationexception: [ldap: error code 49 - 8009030c: ldaperr: dsid-0c09043e, comment: acceptsecuritycontext error, data 0, vece.

please help

https://www.fuzeqna.com/sonicwallkb/consumer/kbdetail.asp?kbid=5266

when testing authentication active directory server, may see error:

authentication error: [ldap: error code 49 - 8009030c: ldaperr: dsid-0c09043e, comment: acceptsecuritycontext error, data 0, vece].

resolution or workaround:

this can occur if host type in remote domain configuration incorrect. change host type active directory (or vice versa):

also check http://www.websina.com/bugzero/faq/ldap-error-code-49.html

a: error caused wrong setting of
java.naming.security.principal.

a full dn must used here, like:

cn=fname lname,ou=orgunit_the_user_stored_in,dc=domain_name,dc=domain_suffix


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -