Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LDAP Context properties and LDAP authentication.

 
butter scotch
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a doubt in LDAP context creation and authentication of a user from LDAP server.

While creating the context of LDAP, i use binding domain name and binding password as shown below:

Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL,"ldap://yoda:391");
env.put(Context.SECURITY_AUTHENTICATION,"simple");
env.put(Context.SECURITY_PRINCIPAL,"cn=directory manager");
env.put(Context.SECURITY_CREDENTIALS,"passwordadmin");
DirContext ctx = new InitialDirContext(env);


Now after successful creation of LDAP context, i want to authenticate one user from LDAP server eg: username : "xyz@domain.com" and password : "passwd1@3".
I am stuck at this point that how to authenticate this user from LDAP server through Java Client.





 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic