dcsimg
Can't Create InitialDirContext with Active Directory
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Craig_Dawson
Posted On:   Monday, September 22, 2003 07:01 AM

I am trying to access Active Directory from Java using java.naming package. Code is standard stuff: env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://myserver:389/"); env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "CN=" + username + ",CN=Users,DC=mydomain,DC=com"); env.put(Context.SECURITY_CREDENTIALS, password); // Create the initial directory context ctx = new InitialDirContext(env); The problem is that the code works for one set of credentials but not for an   More>>

I am trying to access Active Directory from Java using java.naming package. Code is standard stuff:



			
				
env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://myserver:389/");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "CN=" + username + ",CN=Users,DC=mydomain,DC=com");
env.put(Context.SECURITY_CREDENTIALS, password);

// Create the initial directory context
ctx = new InitialDirContext(env);


The problem is that the code works for one set of credentials but not for another. What's weird is that it works for a user who is a member of 'Domain Users' and no other groups. It does not work for certain other accounts that are members of other security groups in addiion to 'Domain Users'. I can't find anything to indicate that any particular groups have been explicitly denied access to AD.



Is there some kind of limitation or bug that prevents certain users from accessing AD in this way?

   <<Less
About | Sitemap | Contact