code: public DirContext authenticateByDnForContext(String userDN, char[] pwd)
  		throws NamingException
  	{
  		Hashtable<String,Object>  env = new Hashtable<String,Object> ();
  	
  	      setupBasicProperties(env, url);
  	
  	      setupSecurityProperties(env, userDN, pwd);
  	
  	      return openContext(env);
  	}
docs: --------------------------------------------