1.3. Setting up a local LDAP Server - rukichen/GrailsGroovyLDAP GitHub Wiki

When you need to develop an Groovy/Grails application that uses LDAP it is useful to setup a local LDAP server. The Apache Directory project provides two useful products:

Apache Directory Server: a full-featured LDAP server completely in Java
Apache Directory Studio: a LDAP tooling platform based on Eclipse which includes ApacheDS

Download and Install Apache Directory Studio We have already Eclipse as GGTS,so you could also install the Apache Directory Studio Plug-ins into your existing Eclipse installation.The update site is http://directory.apache.org/studio/update/. Open the "LDAP perspective after installation is finished.
ldap_local_server_01

Setup and Start Apache Directory Server
You could download a standalone server and import it to ApacheDS, but the simpler version is to have a local server set up via ApacheDS. Open the LDAP Server Tab down and left the window.Click on the New Server icon.
ldap_local_server_02

Select the ApacheDS 2.0.0 and click on Finish
ldap_local_server_03

Back to the LDAP Server Tab. Click on the run icon.
By default it listens to ports 10389 and 10636 (for SSL).
The admin account is "uid=admin,ou=system" and the password is "secret".
ldap_local_server_04

connect to the Server
Now select the tab connection. Make aright click into the field and choose New connection. Enter the data as seen below.
ldap_local_server_06

Change to the authentication tab and enter the information as seen below. Click Finish to close the window.
ldap_local_server_07

Select the just created server and press the connect icon.
ldap_local_server_05

Load sample Data
You can see there is not much data inside. Before we start working with it let's add some data. Open File > New... > LDIF File . This will open den LDIF Browser with an empty file. Then copy/paste the following content into the LDIF editor, ensure that there is a empty line at the end of the content. Finally click the green Execute LDIF button and the data slips into the LDAP server.

link to file

dn: dc=example,dc=com
objectClass: domain
objectClass: top
dc: example

dn: ou=Users,dc=example,dc=com
objectClass: organizationalUnit
objectClass: top
ou: Users

dn: ou=Groups,dc=example,dc=com
objectClass: organizationalUnit
objectClass: top
ou: Groups

dn: cn=Charles Dickens,ou=Users,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
cn: Charles Dickens
sn: Dickens
description: 19741108000000Z
employeeNumber: 7
givenName: Charles
telephoneNumber: 254-323-1920
telephoneNumber: 902-451-7619
uid: cdickens
userPassword:: c2VjcmV0

dn: cn=Jane Austen,ou=Users,dc=example,dc=com
objectClass: inetOrgPerson
objectClass: organizationalPerson
objectClass: person
objectClass: top
cn: Jane Austen
sn: Austen
description: 19650324000000Z
employeeNumber: 3
givenName: Jane
telephoneNumber: 169-637-3314
telephoneNumber: 907-547-9114
uid: jausten
userPassword:: c2VjcmV0

<<Back to 1.2 A new Groovy Project<< >>Next to 2.1 Connect and Search in the LDAP Server>>