The basic prerequisite for using LDAP authentication with the OSGi container is to have an X.500 directory server running and configured with a collection of user entries. For many use cases, you will also want to configure a number of groups to manage user roles.
In this portion of the tutorial you will
Perform the following steps to add user entries to the directory server:
Ensure that the LDAP server and browser are running.
In the LDAP Browser view, drill down to the ou=users node.

Select the ou=users node.
Open the context menu.
Select |.
The New Entry wizard appears.
In the Entry Creation Method pane, check Create entry from scratch.
Click Next.
The Object Classes pane opens.
In the Object Classes pane, select
inetOrgPersonfrom the list of Available object classes on the left.Click Add to populate the list of Selected object classes.
Click .
The Distinguished Name pane opens.
In the the RDN field, enter
uidin front andjdoeafter the equals sign.Click .
The Attributes pane opens.
Fill in the remaining mandatory attributes in the Attributes pane.
Set the cn (common name) attribute to
John DoeSet the sn (surname) attribute to
Doe.
Add a
userPasswordattribute to the user entry.Open the context menu.
Select .
The New Attribute wizard appears.
From the Attribute type drop-down list, select .
Click .
The Password Editor dialog appears.
In the Enter New Password field, enter the password,
secret.Click OK.
The userPassword attribute will appear in the attributes editor.
Click .
Add a user
Jane Doeby following Step 3 to Step 15.In Step 11, use
janedoefor the new user's uid.Add a user
Camel Riderby following Step 3 to Step 15.In Step 11, use
criderfor the new user's uid.
To add the groups that define the roles:
Create a new organizational unit to contain the role groups.
In the LDAP Browser view, select the ou=system node.
Open the context menu.
Select |.
The New Entry wizard appears.
In the Entry Creation Method pane, check Create entry from scratch.
Click Next.
The Object Classes pane opens.
Select
organizationalUnitfrom the list of Available object classes on the left.Click Add to populate the list of Selected object classes.
Click .
The Distinguished Name pane opens.
In the the RDN field, enter
ouin front androlesafter the equals sign.Click .
The Attributes pane opens.
Click .
![[Note]](imagesdb/note.gif)
Note This step is required because Apache DS only allows administrators access to entries in
ou=system,ou=groups.In the LDAP Browser view, drill down to the ou=roles node.
Select the ou=roles node.
Open the context menu.
Select |.
The New Entry wizard appears.
In the Entry Creation Method pane, check Create entry from scratch.
Click Next.
The Object Classes pane opens.
Select
groupOfNamesfrom the list of Available object classes on the left.Click Add to populate the list of Selected object classes.
Click .
The Distinguished Name pane opens.
In the the RDN field, enter
cnin front andadminafter the equals sign.Click .
The Attributes pane opens and you are presented with a DN editor.
Enter
uid=jdoe.Click .
Click .
Add a
sshConsolerole by following Step 3 to Step 15.In Step 11, use
sshConsolefor the new group's cn.In Step 13, use
uid=janedoe.Add a
webconsolerole by following Step 3 to Step 15.In Step 11, use
webconsolefor the new group's cn.In Step 13, use
uid=janedoe.Add a
jmxUserrole by following Step 3 to Step 15.In Step 11, use
jmxUserfor the new group's cn.In Step 13, use
uid=crider.











