LDAP: Installation, Configuration, and Connection

 

 

Installation

 

1.      Download Netscape Directory Server

 

You can find it on \\dogbert\TabletPC\Tools\d601diu.zip

 

Or go to http://sbsdownload.netscape.com/download/index.cgi

Select “Netscape Directory Server”

 

You will need registration to download from Netscape’s web site.

 

2.      Install

 

Unzip the file, run setup.exe.

 

 

Configuration

 

1.      Start Netscape Console.

 

Start Netscape Console. Enter:

      User ID: cn=Directory Manager

      Password: tabletpc

      Administration URL: http://msepc3.sp.cs.cmu.edu:32041

 

2.      Start Directory Server Console.

 

Select “Servers and Applications” tab. Expand the tree on the left side. Select “Directory Server”, and then click “open” on the right panel.

 

3.      Create a root suffix for redx.com.

 

Right click on the “Data” at the right panel, select “create new root suffix”.  Enter:

      New suffix: dc=redx,dc=com

      Check “Create associated database automatically

      Database name: redx

 

4.      Create a root object for redx.com.

 

Select “Directory” tab. Right click on “MSEPC3.sp.cs.cmu.edu:389”. Select “New Root Object”, and “dc=redx,dc=com”. At the appeared dialog box, select “dcobject”, and click “OK”. And then click “OK” at the next dialog box. (Once the root object is created for a root suffix, no more root object could be created for that root suffix again.

 

5.      Create a group for dentist secretary.

 

Right click on “redx” on the right panel. Select “New” -> “group”. At the dialog box, enter “densec” as the group name.

 

6.      Create user entry for dentist secretary.

 

Right click on “densec”, select “New” -> “User”. Enter each field and click “OK”. For example: “uid=yuezhao” and password is “tabletpc”.

 

Connection

 

This is a java example for authentication for yuezhao:

 

import java.util.Hashtable;

import java.util.Enumeration;

import javax.naming.*;

import javax.naming.directory.*;

 

public class AuthenticationTest {

    public static void main(String[] args) {

        try {

            Hashtable env = new Hashtable();

            env.put(Context.INITIAL_CONTEXT_FACTORY,

"com.sun.jndi.ldap.LdapCtxFactory");

            env.put(Context.PROVIDER_URL,

"ldap://msepc3.sp.cs.cmu.edu:389");

            env.put(Context.SECURITY_AUTHENTICATION,

 "simple");

            env.put(Context.SECURITY_PRINCIPAL,

"uid=yuezhao,cn=densec,dc=redx,dc=com");

            env.put(Context.SECURITY_CREDENTIALS,

"tabletpc");

           

            DirContext ctx = new InitialDirContext(env);

           

            System.out.println("Authentication OK");

        } catch (AuthenticationException e) {

            System.out.println("Authentication FAILED");

        }

    }

}