Programming Geek
Rated 4.1/5 based on 446 reviews

Playing With OpenDS

OpenDS is an open source software written in Java that stores hierarchial data. It is a central repository of information. It is not a conventional RDBMS but you can store here user information.

Application:

In a organization, employees record can be stored in OpenDS (centrally) and all other application can use these data to authenticate or display employee details.

Suppose you are developing an application and you have developed the schema for user information in OpenDS. Now while testing your application or while deploying your application, you do not need to move user information from OpenDS. So it can be used in the process Development > Testing > Deployment .

LDAP : LDAP (Lightweight Directory Access Protocol ) is a directory acess protocol using which you can communicate with a directory service such as OpenDS.



While developing a simple web application I needed custom attribute for users in OpenDS. It is simple to create an attribute in OpenDS but the problem is to get it reflected properly in a new entry. So I did research and find out a way to do this.

Watch the video below or read this blog .




Adding new/custom Attribute in OpenDS : 

1. You need to create an ldif file and run a command on console. More information can be found here : http://docs.oracle.com/cd/E19476-01/821-0506/managing-attribute-types.html#to-create-an-attribute-type



2. Using OpenDS Control Panel :

  1. Open OpenDS Control Panel and click on 'Manage Schema' .





    A new window will open showing various options to customize your schema.








Click on “New Attribute” button and enter the new attribute name you want to add as shown below.






The newly added attribute will look like as follows.








Adding new/custom Object Class in OpenDS




1. You need to create a ldif file and run the ldapmodify command on console.  Check here : http://docs.oracle.com/cd/E19476-01/821-0506/managing-object-classes.html#to-create-an-object-class


2.Using OpenDS control panel


Open OpenDS Control Panel and click on “Manage Schema” .

Now you need to add a new object class. So click on 'New Object Class”.












Enter the new object class name and select the parent object class. A list of attribute will be available to you from this parent class. Now select the new custom attribute from left column and add it to the right column as per the priority (i.e. Whether you want to make it a required attribute or optional attribute ) .




Adding entry with custom attribute in OpenDS


Now back to control panel and click “Manage Entries “. Make sure you have already created a Base DN where you will add new entry. I have created a new base DN and a ou as you can see in the picture below.









Now select the ou or DN and create a new user. Enter the required attributes .








The user will be added with the default object class “InetOrgPerson” . We need to change that object class to newly created object class. I have created “ApprovalStatus” as custom attribute and “ird” as custom object class. So let's modify the object class for the entry. Click on 'Edit' button.









Select your custom object class from the list in “Structural Object Class” and click OK.







Now you are done. Just uncheck the check box before “Only Show Attributes With Values” and scroll down the cursor. You will find your newly added attribute there. Cool, That's how you get your custom attribute getting reflected in new entry.