Test LDAP service

One of the first integration tasks undertaken on a new repository installation is to plug it in to the local authentication system. More often than not this is LDAP. It allows users to use their usual local username and password in the repository rather than having to remember another password. LDAP services can be provided by a Microsoft Active Directory (run by most institutions who have Microsoft desktop systems) or dedicated LDAP (e.g. OpenLDAP) service.

One thing I’ve noticed with the DSpace testathons is that often LDAP does not get tested because many of the developers do not have access to an LDAP system – for example in DSpace 1.5 LDAP authentication does not work with Manakin or SWORD. (I have fixed both in the upcoming 1.5.1 though :) ). With this in mind, and because I have to teach a DSpace technical course in 4 days time where we’ll be covering LDAP configuration, I’ve created an open LDAP server which can be used for testing and training.

Details:

Users and their passwords are:

Each user has a full name (Stuart Lewis / John Smith / Carol Jones), a telephone number and email address so should be fully functional.

If you make use of this server, please drop me a line or leave a comment so I know. Otherwise it might get turned off…!

Posted on July 7, 2008 at 5:01 pm by Stuart · Permalink
In: Uncategorized · Tagged with: , ,

43 Responses

Subscribe to comments via RSS

  1. Written by KlausDK
    on August 8, 2008 at 10:39 am
    Permalink

    I use it alot these days.

    Nice service! :-)

    /Klaus

  2. [...] few weeks ago I made a test LDAP service available (read the blog post) in order to allow people without an LDAP service to test their LDAP-related DSpace patches, or to [...]

  3. Written by gopal kankanhalli
    on August 10, 2009 at 12:54 am
    Permalink

    Can you please tell me the bind id for testing

  4. Written by stuart
    on August 10, 2009 at 11:50 am
    Permalink

    Usernames and passwords are shown in the article. Further details can be seen in http://blog.stuartlewis.com/2008/08/18/test-ldap-service-upgraded-now-with-branches/

  5. Written by lisandro
    on May 25, 2010 at 10:42 am
    Permalink

    Hello, can you tell me if this server is still turned on?

  6. Written by Stuart
    on May 29, 2010 at 6:28 pm
    Permalink

    Hi,

    Yes – the server is still turned on. I’ve just tested it and it seemed to work fine.

    Thanks,

    Stuart

  7. Written by mike
    on July 3, 2010 at 7:56 am
    Permalink

    would appreciate your help to test against your server:
    Dim dirEntry As New DirectoryEntry(“LDAP://ldap.testathon.net/OU=users,DC=testathon,DC=net”)
    ‘Setting username & password to Nothing forces
    ‘the connection to use your logon credentials
    dirEntry.Username = “stuart”
    dirEntry.Password = “stuart”
    ‘Always use a secure connection
    dirEntry.AuthenticationType = AuthenticationTypes.None
    Return dirEntry
    error returned is: invalid dn syntax has been specified.
    thank you in advance!

  8. Written by Stuart
    on July 4, 2010 at 4:30 am
    Permalink

    When you log in, you probably need to specify the user’s full DN, which in this case is: CN=stuart,OU=users,DC=testathon,DC=net

  9. Written by Michael
    on July 20, 2010 at 7:34 am
    Permalink

    Hello Stuart, I am trying to test importing non-objectClass=Person users (for example posix accounts) from an online test LDAP server. I am not able to get my integration working on your test LDAP server to test this…..Do you happen to have posix accounts configured on your test LDAP server?

  10. Written by Stuart
    on July 20, 2010 at 10:49 am
    Permalink

    I only have the normal user accounts configured as that is all I need for the testing of systems that I perform. Sorry that I can’t help further.

  11. Written by Diego
    on August 11, 2010 at 2:34 am
    Permalink

    Hello,

    I am new to LDAP and I’m trying to connect to testathon via PHP for the first ime.

    Is it up and running? I keep getting a ‘Protocol error’ regardless if I use ‘CN=stuart,OU=users,DC=testathon,DC=net’ or just ‘stuart’ as a user

    Thanks for your time.

  12. Written by Henry
    on August 12, 2010 at 3:54 am
    Permalink

    Estimado Stuart
    soy nuevo en el tema de Dspace, creo que aun estoy en pañales….sin embargo he logrado avances significativos.

    ya lo tengo instalado bajo Window XP SP2 y tengo un problema. No se como configurar la parte de los mail, para enviar, recibir y/o descargar los correos

  13. Written by Stuart
    on August 29, 2010 at 8:06 pm
    Permalink

    Hi Diego,

    I’ve just tried connecting and it seems to be working fine. To connect, I use ‘CN=stuart,OU=users,DC=testathon,DC=net’ and the password ‘stuart’.

    The PHP code I tested it with is here: http://github.com/stuartlewis/EasyDeposit/blob/master/system/application/controllers/ldaplogin.php

    Thanks,

    Stuart

  14. Written by Stuart
    on August 29, 2010 at 8:08 pm
    Permalink

    Hola Henry,

    Prueba esta URL:

    http://www.dspace.org/1_6_2Documentation/ch05.html#N121D2

    Gracias,

    Stuart

  15. Written by Keith Casey
    on September 11, 2010 at 7:21 pm
    Permalink

    *THANK YOU* for this.

    I’m a developer within web2project and we’ve had *so* many problems getting a good test environment setup. No one within the team has any useful experience with LDAP but some of our community uses it extensively. Your test server gave me a fighting chance to debug some things. ;)

  16. Written by jackson
    on September 16, 2010 at 10:02 am
    Permalink

    what is Domain (Base DN)
    ldap.testathon.net
    dc=ldap,dc=testathon,dc=net
    don;t seem to work

  17. Written by Stuart
    on September 22, 2010 at 3:20 pm
    Permalink

    Hi Peter,

    All the users exist within OU=users,DC=testathon,DC=net

    Thanks,

    Stuart

  18. Written by rix0r
    on January 28, 2011 at 6:38 am
    Permalink

    Thanks so much for this! I don’t think I could’ve developed my authentication/search backend without testing it against an actual server.

  19. Written by Gary
    on February 9, 2011 at 11:26 pm
    Permalink

    Hello Stuart.

    Not a lot of LDAP experience and I have been trying to configure a quick LDAP server for testing API code for Adding, Deleting, Locking and Unlocking a user.

    Does your test server allow for creating users? I could see not allowing deleting but maybe even locking or unlocking?

    Believe I have the code ready to test just no way to test it locally on VM with 2003 server.

    If not do you know of some easy stadalione LDAP server I can get running in quickly to test my code?

    Thanks.
    Gary

  20. Written by Stuart
    on February 10, 2011 at 10:23 am
    Permalink

    Hi Gary,

    I’m afraid that the test server is locked down pretty tightly – no updates / creates etc are allowed. If you have a linux box, openldap is pretty easy to run, or you could take a look at Apache Directory (http://directory.apache.org/).

    Thanks,

    Stuart

  21. Written by Gary
    on February 11, 2011 at 3:09 am
    Permalink

    Thanks for replying. Amazing that through all my google searching for open source LDAP it took drilling down through several sites to find their is an OpenLDAP for Windows with an install. Was able to install and get it configured for testing. Thanks again for your help.

  22. [...] given directory type to test against, please let me know. I found a public instance of OpenLDAP at http://blog.stuartlewis.com/2008/07/07/test-ldap-service/, OpenLDAP allegedly has one also at ldap.openldap.org but that doesn’t work for me. I get Server [...]

  23. Written by Jeff Standen
    on July 30, 2011 at 8:43 am
    Permalink

    Thanks for this! It saved me some development time while building an LDAP plugin for a popular web framework.

  24. Written by Richard
    on July 30, 2011 at 9:22 am
    Permalink

    Wow. First of all, thank you so much for this. Secondly, though, I can’t get a bind to work. Is the server still available? Here’s the code–it’s about as simple as you get and dies at the bind:

    $ldapHost = “ldap.testathon.net”;
    $ldapPort = “389″;
    $ldapUser =”CN=stuart,OU=users,DC=testathon,DC=net”;
    $ldapPswd =”stuart”;

    $ldapLink =ldap_connect($ldapHost, $ldapPort)
    or die(“Can’t establish LDAP connection”);

    ldap_bind($ldapLink,$ldapUser,$ldapPswd)
    or die(“Can’t bind to server.”);

  25. Written by Stuart
    on July 30, 2011 at 7:38 pm
    Permalink

    Add the following line between the connect and the bind:

    ldap_set_option($ldapLink, LDAP_OPT_PROTOCOL_VERSION, 3);

  26. Written by Richard
    on July 31, 2011 at 12:06 am
    Permalink

    Thanks so much for the reply! I had already tried that though, but I tried again just to check. Here’s the code:

    $ldapHost = “ldap.testathon.net”;
    $ldapPort = “389″;
    $ldapUser =”CN=stuart,OU=users,DC=testathon,DC=net”;
    $ldapPswd =”stuart”;

    $ldapLink =ldap_connect($ldapHost, $ldapPort)
    or die(“Can’t establish LDAP connection”);

    ldap_set_option($ldapLink, LDAP_OPT_PROTOCOL_VERSION, 3);

    ldap_bind($ldapLink,$ldapUser,$ldapPswd)
    or die(“Can’t bind to server.”);

    This results in a Warning: ldap_bind() [function.ldap-bind]: Unable to bind to server error. I’ve tried from two different servers, but I’m sure that this is just a small programming error… I just can’t see what I’m doing wrong!

  27. Written by Stuart
    on July 31, 2011 at 7:29 am
    Permalink

    This code works for me, and prints out the email address of a user:

    $ldapHost = “ldap://ldap.testathon.net:389″;
    $ldapUser =”CN=stuart,OU=users,DC=testathon,DC=net”;
    $ldapContext = “OU=users,DC=testathon,DC=net”;
    $ldapPswd =”stuart”;

    $ldapLink =ldap_connect($ldapHost)
    or die(“Can’t establish LDAP connection”);

    ldap_set_option($ldapLink, LDAP_OPT_PROTOCOL_VERSION, 3);

    ldap_bind($ldapLink,$ldapUser,$ldapPswd)
    or die(“Can’t bind to server.”);

    $searchresult = ldap_search($ldapLink, $ldapContext, “cn=stuart”);
    $items = ldap_get_entries($ldapLink, $searchresult);
    echo $items[0]["mail"][0] . “\n”;

  28. Written by Richard
    on July 31, 2011 at 3:49 pm
    Permalink

    Hmmm. Thanks for the code. What’s odd is that even if I cut and paste that code into a new php file on either server, I get the same unable to bind warning. Ugh! I’ll keep messing though…

  29. Written by Richard
    on August 1, 2011 at 12:27 am
    Permalink

    Ha! The server firewalls were blocking the port. It’s fixed now. Thanks so much!

  30. Written by George
    on September 22, 2011 at 9:24 am
    Permalink

    Is the server still up? I am having connection problems.

  31. Written by Stuart
    on September 22, 2011 at 9:41 am
    Permalink

    Sorry George – slapd on my server was playing up. I have now re-started it, and it should work.

  32. Written by Luis
    on October 8, 2011 at 3:16 am
    Permalink

    Thanks a lot for the server Stuart.
    I was unable to test my ldap script until i found your blog.
    It’s make my life easier!

  33. Written by Harald
    on November 6, 2011 at 9:49 pm
    Permalink

    Thanks for providing this service :-)

  34. Written by Karim Duran
    on November 25, 2011 at 6:03 am
    Permalink

    Hi, Stuart
    Thank you very much for this online ldap test server. I can test my JAVA, C# code with an other machine than mine. It works fine.

  35. Written by Karim Duran
    on November 25, 2011 at 6:15 am
    Permalink

    Hi Stuart,

    I found an interesting public ldap server here :
    http://keutel.de/directory/public_ldap_servers.html

    But i didn’t test all servers. Some work.

    Thanks.

  36. Written by Naveen
    on December 7, 2011 at 12:18 am
    Permalink

    Thank you Stuart. Your test LDAP server is of great help!
    Much appreciated!!

  37. Written by Lorraine
    on December 13, 2011 at 11:52 pm
    Permalink

    Thank you very much, it helps a lot.
    It would be so nice if we could create/update entries :D

  38. Written by Wim
    on December 20, 2011 at 3:52 am
    Permalink

    Thanks for this!

  39. Written by Hugh McGowan
    on December 20, 2011 at 2:43 pm
    Permalink

    Fantastic! You just saved me a ton of time – many thanks!

  40. Written by Karl Anderson
    on January 4, 2012 at 11:45 am
    Permalink

    Just commenting to say thanks, I’m using it for testing.

  41. Written by Paul
    on January 18, 2012 at 11:46 pm
    Permalink

    Thanks alot Stuart! Awesome for testing connections :)

  42. Written by Jean (from France)
    on January 21, 2012 at 5:40 am
    Permalink

    Thanks a lot, Stuart. Very useful for testing.

    Could you possibly add a picture (ldap attribute : jpegPhoto), for instance for “stuart” as I’m currently testing an addon for Thunderbird for reading such kind of data in ldap directory ?

    If you are interested, see
    http://adullact.net/plugins/mediawiki/wiki/milimail/index.php/Directory_Contact_Tabs

    It was working well for Thunderbird 3.x, I’m testing it for Thunderbird 9.0

    Jean

  43. Written by Ben
    on February 3, 2012 at 11:22 pm
    Permalink

    Thanks a lot. I’m happy that I found a LDAP servic for testig.

Subscribe to comments via RSS

Leave a Reply