Results 1 to 3 of 3
Thread: Configuring LDAP and JAVA
- 04-19-2007, 06:31 AM #1
Member
- Join Date
- Mar 2007
- Posts
- 41
- Rep Power
- 0
- 04-19-2007, 06:45 AM #2
Senior Member
- Join Date
- Mar 2007
- Posts
- 134
- Rep Power
- 0
The following example shows how, by using a simple clear-text password, a client authenticates to an LDAP server.
If it returns DirContext then there is no error else it will throws exceptionJava Code:// Set up the environment for creating the initial context Hashtable env = new Hashtable(); env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.ldap.LdapCtxFactory"); env.put(Context.PROVIDER_URL, "ldap://localhost:389/o=JNDITutorial"); // Authenticate as S. User and password "mysecret" env.put(Context.SECURITY_AUTHENTICATION, "simple"); env.put(Context.SECURITY_PRINCIPAL, "cn=S. User, ou=NewHires, o=JNDITutorial"); env.put(Context.SECURITY_CREDENTIALS, "mysecret"); // Create the initial context DirContext ctx = new InitialDirContext(env); // ... do something useful with ctx
- 04-19-2007, 06:46 AM #3
Senior Member
- Join Date
- Mar 2007
- Posts
- 134
- Rep Power
- 0
Similar Threads
-
Configuring Jboss with Eclipse
By javaplus in forum Advanced JavaReplies: 3Last Post: 05-07-2009, 11:16 AM -
CompositeName with LDAP URL
By Java Tip in forum Java TipReplies: 0Last Post: 01-10-2008, 10:43 AM -
Configuring Enterprise Application Servers In NetBeans IDE
By JavaForums in forum NetBeansReplies: 0Last Post: 07-30-2007, 11:13 PM -
Configuring Xdoclet for J2ee Applications in Eclipse
By JavaForums in forum EclipseReplies: 0Last Post: 04-26-2007, 10:15 AM -
Configuring J2EE Environment on Eclipse IDE
By JavaForums in forum EclipseReplies: 0Last Post: 04-26-2007, 10:15 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks