Solved

Where to download tiny LDAP server for window to test JNDI programs?

Posted on 2002-07-13
8
1,334 Views
Last Modified: 2013-11-24
Dear experts,
  I want to download a tiny/free LDAP server for window version to test my own JNDI programs. But I've no idea where can I download it. Please tell me where can I download it. If possible, can you teach me how to configure it ?

Thank you. :)
0
Comment
Question by:JavaSlave
8 Comments
 
LVL 5

Expert Comment

by:fontaine
Comment Utility
http://www.eudora.com/free/ldap.html

I have never used it, however.
0
 
LVL 3

Expert Comment

by:gandalf94305
Comment Utility
I recommend OpenLDAP from http://www.openldap.org/

Check out the web site, it has examples and the LDAP server itself is relatively easy to configure. HOWEVER, don't expect this to be as easy as running a setup.exe and defining a database table or two. Before doing this, read about the basics of LDAP. You'll find that information on the OpenLDAP site, too.

If you don't want to set up your own LDAP service, try accessing one of the public servers. There are a few lists around, e.g., http://www.emailman.com/ldap/public.html

So, for testing purposes, if you don't have to use specific schema extensions, use one of the public servers. Otherwise, read a bit more and try your luck with OpenLDAP.

Cheers,
--gandalf.
0
 

Author Comment

by:JavaSlave
Comment Utility
Sorry gandalf94305,
  I can't find any window version from the website..

  My main purpose is that i want to define a JDBC source name, and use JNDI to get JDBC connection from the source though some LDAP service provider. Can I define it in those global LDAP server?

  Please advice me about this topice. Thank..
0
 
LVL 5

Expert Comment

by:fontaine
Comment Utility
As far as I know about, OpenLDAP is only available for UNIX systems, indeed.
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 3

Expert Comment

by:gandalf94305
Comment Utility
OpenLDAP is indeed available on Windows. Check out http://www.fivesight.com/downloads/openldap.asp (also mentioned in the FAQ). Compile it yourself or simply download the binaries.

In my opinion, if you want to play with a serious LDAP server, this is probably the best free one around, able to take it up with many commercial servers.

With JNDI, you would use something like this:

  private DirContext theContext = null;
  private Object lock = new Object();

  protected static String MY_INITIAL_CONTEXT_FACTORY =
    "com.sun.jndi.ldap.LdapCtxFactory";

  protected DirContext initializeLDAP(Hashtable config) {

    if (!config.get("ldap.keepalive.context").equals("yes")) {
      return initializeLDAP_newContext(config);
    }

    if (theContext == null) {
      synchronized (lock) {
     if (theContext == null) {
       theContext = initializeLDAP_newContext(atoms);
     }
      }
    }
    return theContext;
  }

  private DirContext initializeLDAP_newContext(Hashtable config) {
    DirContext context = null;
    Hashtable env = new Hashtable(11);

    // java.naming.factory.initial
    env.put(Context.INITIAL_CONTEXT_FACTORY, MY_INITIAL_CONTEXT_FACTORY);
   
    // java.naming.provider.url
    env.put(Context.PROVIDER_URL, config.get("ldap.service"));

    // java.naming.security.authentication
    // -  CRAM-MD5, none, simple, strong
    env.put(Context.SECURITY_AUTHENTICATION, config.get("ldap.authentication"));
   
    // java.naming.security.principal
    // -  dname of the principal to be authenticated
    //env.put(Context.SECURITY_PRINCIPAL, "");

    // java.naming.security.credentials
    // -  credentials for the principal according to the
    //    selected authentication scheme.
    // env.put(Context.SECURITY_CREDENTIALS, "");

    // java.naming.security.protocol
    // env.put(Context.SECURITY_PROTOCOL, "ssl");

    // java.naming.ldap.version
    // env.put("java.naming.ldap.version", "3");

    // Get a handle to an initial directory context
    try {
      context = new InitialDirContext(env);
    } catch (NamingException e) {
      // Log.error(HERE, "cannot initialize LDAP", e);
    }
    return context;
  }

You simply use LDAP v2/v3 to connect to the LDAP server, no JDBC involved here directly. For even more sample code, go to places like http://www-unix.mcs.anl.gov/~chen/talks/jndi-ldap/5.html

One other tool you may find interesting is Softerra's LDAP browser: http://www.ldapadministrator.com/

--gandalf.
0
 

Expert Comment

by:ReRun07
Comment Utility
One of my developers wants to know how much data a keepalive for LDAP produces?  Basically, he wants to know if we have we should keep a connection open to an LDAP server or close it after each use.  I hope this is enough information.
0
 
LVL 5

Expert Comment

by:vemul
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- To be PAQ'ed and points not refunded

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

vemul
Cleanup Volunteer
0
 
LVL 1

Accepted Solution

by:
Computer101 earned 0 total points
Comment Utility
Question placed in PAQ

Computer101
E-E Admin
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now