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:
- ldap.provider_url = ldap://ldap.testathon.net:389/
- ldap.id_field = cn
- ldap.object_context = OU=users,DC=testathon,DC=net
- ldap.search_context = OU=users,DC=testathon,DC=net
- ldap.email_field = mail
- ldap.surname_field = sn
- ldap.givenname_field = givenName
- ldap.phone_field = telephoneNumber
Users and their passwords are:
- stuart / stuart
- john / john
- carol / carol
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…!
In: Uncategorized · Tagged with: dspace, ldap, repositories



on August 8, 2008 at 10:39 am
Permalink
I use it alot these days.
Nice service!
/Klaus
on August 18, 2008 at 4:59 pm
Permalink
[...] 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 [...]
on August 10, 2009 at 12:54 am
Permalink
Can you please tell me the bind id for testing
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/
on May 25, 2010 at 10:42 am
Permalink
Hello, can you tell me if this server is still turned on?
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
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!
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
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?
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.
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.
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
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
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
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.
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
on September 22, 2010 at 3:20 pm
Permalink
Hi Peter,
All the users exist within OU=users,DC=testathon,DC=net
Thanks,
Stuart
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.
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
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
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.
on February 16, 2011 at 1:01 pm
Permalink
[...] 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 [...]
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.
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.”);
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);
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!
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”;
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…
on August 1, 2011 at 12:27 am
Permalink
Ha! The server firewalls were blocking the port. It’s fixed now. Thanks so much!
on September 22, 2011 at 9:24 am
Permalink
Is the server still up? I am having connection problems.
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.
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!
on November 6, 2011 at 9:49 pm
Permalink
Thanks for providing this service
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.
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.
on December 7, 2011 at 12:18 am
Permalink
Thank you Stuart. Your test LDAP server is of great help!
Much appreciated!!
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
on December 20, 2011 at 3:52 am
Permalink
Thanks for this!
on December 20, 2011 at 2:43 pm
Permalink
Fantastic! You just saved me a ton of time – many thanks!
on January 4, 2012 at 11:45 am
Permalink
Just commenting to say thanks, I’m using it for testing.
on January 18, 2012 at 11:46 pm
Permalink
Thanks alot Stuart! Awesome for testing connections
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
on February 3, 2012 at 11:22 pm
Permalink
Thanks a lot. I’m happy that I found a LDAP servic for testig.