{"id":1312,"date":"2013-08-01T22:16:32","date_gmt":"2013-08-01T10:16:32","guid":{"rendered":"http:\/\/www.zoyinc.com\/?p=1312"},"modified":"2013-09-29T19:47:36","modified_gmt":"2013-09-29T06:47:36","slug":"apache-directory-studio","status":"publish","type":"post","link":"http:\/\/www.zoyinc.com\/?p=1312","title":{"rendered":"Apache Directory Studio"},"content":{"rendered":"<p style=\"text-align: left;\"><a  href=\"http:\/\/directory.apache.org\/studio\/\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-1389\" alt=\"Apache Directory Studio\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/ApacheDirectoryStudio2.jpg\" width=\"362\" height=\"174\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/ApacheDirectoryStudio2.jpg 453w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/ApacheDirectoryStudio2-150x71.jpg 150w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/ApacheDirectoryStudio2-300x143.jpg 300w\" sizes=\"auto, (max-width: 362px) 100vw, 362px\" \/><\/a>I recently started playing with OpenLDAP and as a consequence went on the search for a LDAP client. I had been using the Softerra LDAP browser several years ago and it seemed to do what I want but I now see the free version is somewhat limited so I went looking.<\/p>\n<p>I found the Apache Directory projects &#8220;Apache DS&#8221;, the LDAP server component and the &#8220;Apache Directory Studio&#8221; the LDAP administrator\/browser tool. Directory studio utilizes the Eclipse framework, so if you are used to using Eclipse that will help.<\/p>\n<p>In reality I found the Apache DS to be a pain to get working under Windows and found that OpenLDAP for Windows from UserBooster was easy to install and worked well. However this article is not about LDAP, as such, it&#8217;s intention is a place for me to remember some of the bits about how to use the Apache Directory Studio.<\/p>\n<p>I have added a post <a  title=\"OpenLDAP for Windows\" href=\"http:\/\/www.zoyinc.com\/?p=1315\">OpenLDAP for Windows<\/a> which has brief description of installing OpenLDAP. Neither article is intended as a how-to for LDAP there are lots of places on the Internet with this information.<\/p>\n<p>As you can tell I chose to use Apache Directory Studio as my LDAP client. Revisiting the subject I see there are quite a few LDAP clients and possibly Apache is not the best ?<\/p>\n<h2>Resources<\/h2>\n<h4>OpenLDAP for Windows &#8211; Userbooster<\/h4>\n<p><a  href=\"http:\/\/userbooster.de\/en\/download\/openldap-for-windows.aspx\">http:\/\/userbooster.de\/en\/download\/openldap-for-windows.aspx<\/a><a  href=\"http:\/\/userbooster.de\/en\/download\/openldap-for-windows.aspx\"><br \/>\n<\/a>I used this as my LDAP server on Windows<\/p>\n<h4>Apache Directory Studio<\/h4>\n<p><a  href=\"http:\/\/directory.apache.org\/studio\/\">http:\/\/directory.apache.org\/studio\/<\/a><\/p>\n<p>This site has excellent documentation and of course you can download from here.<\/p>\n<h2>Installation<\/h2>\n<p>I am not going to detail the installation of Directory Studio as it&#8217;s a simple exe you just accept the defaults and all is good. Suffice to say if you choose to use an existing JRE\/JDK you must be careful that if you have a 64bit JRE\/JDK then you must use the 64bit Directory Studio and equally for 32bit installs.<\/p>\n<p>Once you have installed and started Directory Studio the first thing to do is close the &#8220;Welcome&#8221; pane. Then select:<\/p>\n<p style=\"padding-left: 30px;\">Window | Open Perspective | LDAP<\/p>\n<h2>How-Tos<\/h2>\n<p>The point of this post is to give me a place to put info on using the Apache client so I can reference it later. This is driven by the fact that not everything in the current version of the Directory Studio is quite as intuitive as it might be.<\/p>\n<h3>Connecting to LDAP<\/h3>\n<p>Even if you are connecting to LDAP on your local PC\/Laptop you still need to configure a host name and port. Assuming you have select the &#8220;LDAP&#8221; perspective look for the &#8220;Connection&#8221; pane, probably around the bottom left of the Studio window:<\/p>\n<p><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V6.gif\" class=\"thickbox no_icon\" title=\"Connections Pane\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1336\" alt=\"Connections Pane\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V6.gif\" width=\"204\" height=\"91\" \/><\/a>Right click the pane and create a new connection:<\/p>\n<table class=\"zsteps\" border=\"0\">\n<tbody>\n<tr>\n<td><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V7.gif\" class=\"thickbox no_icon\" title=\"Apache Directory Studio New Connection\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" alt=\"Apache Directory Studio New Connection\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V7.gif\" width=\"325\" height=\"242\" \/><\/a><\/td>\n<td><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V8.gif\" class=\"thickbox no_icon\" title=\"Apache Directory Studio New Connection\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" alt=\"Apache Directory Studio New Connection\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V8.gif\" width=\"325\" height=\"211\" \/><\/a><\/td>\n<\/tr>\n<tr>\n<td><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V9.gif\" class=\"thickbox no_icon\" title=\"Apache Directory Studio New Connection\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" alt=\"Apache Directory Studio New Connection\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V9.gif\" width=\"325\" height=\"293\" \/><\/a><\/td>\n<td><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V10.gif\" class=\"thickbox no_icon\" title=\"Apache Directory Studio New Connection\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" alt=\"Apache Directory Studio New Connection\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/07\/LDAP2013V10.gif\" width=\"325\" height=\"151\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>To open a connection simply double click on the new connection you just created.<\/p>\n<p>&nbsp;<\/p>\n<h3>Running an LDIF file<\/h3>\n<p>A *.ldif file is a list of LDAP entries which allows you to add or modify LDAP entries. You can use this to populate you repository. So it would typically look like:<\/p>\n<pre class=\"crayon:false;\"># Sample domain definition\r\ndn: dc=example,dc=com\r\ndc: example\r\ndescription: My domain description\r\nobjectClass: dcObject\r\nobjectClass: organization\r\no: Example, Inc.\r\n\r\n# Organizational Unit People\r\ndn: ou=people, dc=example,dc=com\r\nou: people\r\ndescription: everyone in the company\r\nobjectclass: organizationalunit<\/pre>\n<p>Directory Studio includes a tool to allow you to do this. There are actually a number of ways to invoke this the way I do it is to select: &#8220;LDAP | New LDIF File&#8221;.<\/p>\n<table class=\"zsteps\" border=\"0\">\n<tbody>\n<tr>\n<td><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V11.gif\" class=\"thickbox no_icon\" title=\"LDIF Import\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-1371\" alt=\"LDIF Import\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V11.gif\" width=\"312\" height=\"216\" \/><\/a><\/td>\n<td><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V12.gif\" class=\"thickbox no_icon\" title=\"LDIF importer\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-1372\" alt=\"LDIF importer\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V12.gif\" width=\"289\" height=\"119\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Simply type the details in the LDIF window and click on the green &#8220;Play&#8221; arrow in the top right corner to run the script. This is a great way to test bits of your LDIF file that are giving you trouble.<\/p>\n<h3>Importing from an LDAP server<\/h3>\n<p>From time to time you may want to copy or clone an entry from one LDAP server to another &#8211; you may even want to copy everything. Directory studio has some tools to help you. Be warned if you are copying from dis-similar LDAP server applications you may have problem because different LDAP vendors do things differently and what works for one may not work for another in the same way.<\/p>\n<p style=\"text-align: left;\">To import one object simply right click on the object and select &#8220;Advanced | Copy Entry as LDIF (all user attributes)&#8221;<a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V13.gif\" class=\"thickbox no_icon\" title=\"Get object attributes\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-1377\" alt=\"Get object attributes\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V13.gif\" width=\"487\" height=\"418\" \/><\/a>If you then paste the details into a text editor or the LDIF editor in Studio, it will be a valid LDIF entry for re-creating the entry:<\/p>\n<pre class=\"crayon:false; crayon-selected\">dn: ou=People,dc=maxcrc,dc=com\r\nobjectClass: organizationalUnit\r\nobjectClass: top\r\nou: People\r\ndescription: Container for user entries<\/pre>\n<p>If you want to get more objects at a time in the form of one long LDIF file, simply select the top most entry of the tree you want to export and right click:<\/p>\n<p style=\"padding-left: 30px;\">Export | LDIF Export&#8230;<\/p>\n<p>You will get a dialog similar to:<\/p>\n<table class=\"zsteps\" border=\"0\">\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V14.gif\" class=\"thickbox no_icon\" title=\"LDIF Export\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-1378 aligncenter\" alt=\"LDIF Export\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V14.gif\" width=\"307\" height=\"424\" \/><\/a><\/td>\n<td><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V15.gif\" class=\"thickbox no_icon\" title=\"LDIF Export\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter\" alt=\"LDIF Export\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V15.gif\" width=\"307\" height=\"424\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Be careful on the first dialog to select &#8220;Subtree&#8221; and it&#8217;s handy to select &#8220;Overwrite existing LDIF file&#8221; on the second dialog.<\/p>\n<h3>Getting class or attribute details<\/h3>\n<p>LDAP entries, such &#8220;fred.dagg&#8221; are made up of classes and attributes and classes are made up of various definition details and one or more attributes. Again this is not a lesson about LDAP there are many fine resources on the web on that topic.<\/p>\n<p>To get details of a class used by a particular entry I will give as an example the entry in my tree &#8220;fred.dagg&#8221;.<\/p>\n<ul>\n<li>Click on the entry &#8220;fred.dagg&#8221; to display its details in the adjoining panel.<\/li>\n<li>then right click the class you want to investigate, in our case &#8220;person (structural)&#8221; and select &#8220;Open Schema Browser | Object Class Description&#8221;:<\/li>\n<\/ul>\n<p style=\"text-align: left;\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V16.gif\" class=\"thickbox no_icon\" title=\"Get class details\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-1381\" alt=\"Get class details\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V16.gif\" width=\"628\" height=\"189\" \/><\/a>This will reveal the following:<\/p>\n<p style=\"text-align: left;\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V17.gif\" class=\"thickbox no_icon\" title=\"Class details\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1382\" alt=\"Class details\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V17.gif\" width=\"394\" height=\"293\" \/><\/a><\/p>\n<p style=\"text-align: left;\">There are a number of interesting things to this panel but one thing I found particularly helpful was expanding the &#8220;RawSchemaDefinition&#8221;. This gave me the exact, as in cut and paste, text to recreate this class in OpenLDAP:<\/p>\n<p style=\"text-align: left;\"><a  href=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V18.jpg\" class=\"thickbox no_icon\" title=\"Class definition\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image-1383\" alt=\"Class definition\" src=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V18.jpg\" width=\"200\" height=\"179\" srcset=\"http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V18.jpg 250w, http:\/\/www.zoyinc.com\/wp-content\/uploads\/2013\/08\/LDAP2013V18-150x134.jpg 150w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<p style=\"text-align: left;\">To put this into OpenLDAP simply add the text highlighted about into a schema file in the &#8220;\/schema&#8221; directory of your LDAP server &#8211; you will of course have to prefix the entry with &#8220;objectClass&#8221;.<\/p>\n<h2 style=\"text-align: left;\">Thats it<\/h2>\n<p style=\"text-align: left;\">I hope this has helped. The reason I wrote this article was so that when I came back to use Studio months later I would have a reference. Unfortunately this means if you have any question I may well not know the answer \ud83d\ude42<\/p>\n<p style=\"text-align: left;\">\n","protected":false},"excerpt":{"rendered":"<p>I recently started playing with OpenLDAP and as a consequence went on the search for a LDAP client. I had been using the Softerra LDAP browser several years ago and it seemed to do what I want but I now see the free version is somewhat limited so I went looking. I found the Apache [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":1389,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[135],"tags":[142,145,143,144,146],"class_list":["post-1312","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-general","tag-apache-directory-studio","tag-eclipse","tag-ldap","tag-ldif","tag-software"],"_links":{"self":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/1312","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1312"}],"version-history":[{"count":21,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/1312\/revisions"}],"predecessor-version":[{"id":1645,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/posts\/1312\/revisions\/1645"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=\/wp\/v2\/media\/1389"}],"wp:attachment":[{"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1312"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1312"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zoyinc.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1312"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}