Please suggest me which could be more reasons beacuase with blank password the code runs fine. It does not throw any exception. Context.SECURITY_AUTHENTICATION type is "simple". If it is "simple" then it password entered should be accurate it should not take blank password as well. I am stuck...
Joined: Aug 29, 2003
My code that seems to work ok is like this:
Hashtable props = new Hashtable(); props.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory"); props.put(Context.PROVIDER_URL,"ldap://servername:389"); props.put(Context.SECURITY_PRINCIPAL,"cn=" + name); props.put(Context.SECURITY_CREDENTIALS,password); ctx = new InitialDirContext(props); verification = true;
What happens if you leave out the SECURITY_AUTHENTICATION line as I don't use it?
Joined: Aug 20, 2004
Rob, I am glad to get your reply. But I tried with your code as well. It is allowing everyone with blank password. Yes ofcourse it allows with the original password and do not allow for wrong password. But it allows for blank password. I tried with your code at my environment