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.


  • 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…!mobi game

204 thoughts on “Test LDAP service

  1. Darwin

    I use this server with Symfony2 to test LDAP authentication, thank you so much for this tool, so helpfull πŸ™‚

  2. Vader

    I got the error. Thought?

    res = ldap_simple_bind_s(ld, ‘carol’, ); // v.3
    Error : ldap_simple_bind_s() failed: Invalid DN Syntax
    Server error: invalid DN

  3. Jed Anderson

    Thanks for running this server! It’s great help to those who need to do some quick LDAP testing. We’re using it to write an example Java->LDAP integration for our Eclipse delivery software, Secure Delivery Center. For those who are curious, http://genuitec.com/sdc.

    It’s always awesome to find somebody has done exactly what you want/need to do and is letting others use that service. Kudos!

  4. Peter

    Great post! i am using this LDAP server for testing with a Django app i am developing. I am using django-auth-ldap and have the following basic configuration for anonymous binding in my settings.py:

    AUTH_LDAP_SERVER_URI = “ldap://ldap.testathon.net:389/”
    AUTH_LDAP_USER_SEARCH = LDAPSearch(“ou=users,dc=testathon,dc=net”,
    ldap.SCOPE_SUBTREE, “(uid=%(user)s)”)

  5. Tolga

    Hey, could you please give its DN info? When I was trying to authenticate those users, i got ” Invalid Credentials” error.

  6. feki

    Thanks for this post. I’m working with php symfony2 and BorisMorel Bundle for LDAP.
    For me, I had to specify the version v3 to work:
    host: your.host.foo
    port: 389
    version: 3

  7. Peter

    Thanks a lot. At least now I know my code connects to an ldap … but something is wrong with a secure ldap connection. Could you host a secure ldap too?

    Thanks again πŸ™‚ Peter

  8. Arman

    Nice, it works !! This is my settings :

    java.naming.factory.initial : com.sun.jndi.ldap.LdapCtxFactory
    java.naming.provider.url : ldap://ldap.testathon.net:389
    java.naming.security.authentication : simple
    java.naming.security.principal : cn=stuart,ou=users,dc=testathon,dc=net
    java.naming.security.credentials : stuart

    thank you very much for this test service !

  9. Erik

    Works fine with the PHP LDAP class. Was struggling a bit with invalid credentials, make sure you use ‘CN=stuart,OU=users,DC=testathon,DC=net’ in ldap_connect().

    Thanks for making this available!

  10. Alex

    Hello, thank you for your helpful tool,
    I am using C# but after run the codes I got this error “The server is not operational” I read
    this article> it said this issue may occur if DNS is improperly configured,
    I am using:
    DirectoryEntry entry = new DirectoryEntry(“LDAP://ldap.testathon.net:389/ou=Users,dc=testathon,dc=net”, “CN=stuart,OU=Users,DC=testathon,DC=net”, “stuart”, AuthenticationTypes.None);
    object obj = entry.NativeObject;
    I also checked the connection and port they are seems ok
    any idea would be appreciated.

  11. Lance Logan

    I used this to test new firmware on an AMX control system. I didn’t know what LDAP was a few weeks ago, so a simple resource like this is super valuable. Thank you.

  12. Steve

    Fab…thanks Stuart…this might just get me my next role, as I needed to dust down some old Java code done back in 2003 and I had nothing to test against.

  13. Richard Selby

    Thanks Stuart, very publicly spirited of you. I am trying this out with ServiceNow LDAP integration. In their setup, they don’t allow anonymous connection. I have to supply a Login Distinguised Name and Login password. Is there one I can use? I have tried CN=john,OU=Users,DC=testathon,DC=net as a login, and a blank pass, but no good.

  14. Stuart Post author

    Richard: if you’re using cn=john etc for the initial distinguished login, then the password should be ‘john’ too, rather than being blank.

  15. Radian


    Is this ldap server up and running?

    I tried to connect tot it using Apache directory Studio and I get “Connection timeout”.
    I’ve tried with DN/user “cn=john,ou=Users,dc=testathon,dc=net” and password “john” and address “” port 389 and also address “ldap.testathon.net” and port 389, but still cannot connect.
    Am I missing something?


  16. RN

    Thanks Stuart. I am using your LDAP server through Oracle PL/SQL code.
    l_return:= dbms_ldap.simple_bind_s( l_session, ‘CN=carol,ou=users,DC=testathon,dc=net’, ‘carol’ );
    This code is supposed to give 1 if user credentials are verified , otherwise 0. I am getting 0 all the time for all the three users you listed. Any idea?


  17. Michael Pasic

    Thank-you so much for keeping this available .
    Just had a client fail to find anyone on their LDAP server from multiple copiers in multiple cities.
    This allowed me to prove that the problem was on their network not the copiers that I service.

    Note Authentication Type I used was Anonymous no user or password required
    note search found names starting with a to f and s. Did not test all other letters but some others found no names

  18. Thomas

    Thanks a thon – the rootDSE does not give a lot away about the server (which is normal for a public server) but for the curious minds – which ldap server is this actually?

  19. Sankardoss P

    Thanks for the post. I use below configuration, however I am not able to authenticate. Please suggest. Thanks again

  20. AceForce

    I am trying to use the LDAP Server. Could you provide a test “Admin” user? For the purpose of my testing, I need admin privileges. If there is something like a user-admin, which only gives permission to read all user data, that should suffice my need.


  21. Pingback: Flask Authentication With LDAP - Innovative Studio

  22. Pingback: Flask Authentication With LDAP | MotionBump Reader

  23. Pingback: Design n Code » Flask Authentication With LDAP

  24. Pingback: Flask Authentication With LDAP | CodangoNet

  25. Pingback: Flask Authentication With LDAP - InfoLogs

  26. Pingback: Flask Authentication With LDAP | Your Web App

  27. sunny

    thanks, stuart. i need to test ldap with php and you save me a lot of time to setup a dummy ladp server for testing. thanks again and you save me a lot of time. πŸ™‚

  28. val

    Many thanks Stuart !
    Great tool.
    with the help of your server I setup Mercurial central repository published via Nginx + uwsgi

    BTW the ldap url for nginx_auth_ldap plugin
    url “ldap://ldap.testathon.net:389/OU=users,DC=testathon,DC=net?CN?sub?(objectClass=person)”

    CN to be used instead of sAMAccountName from official plugin

    url “ldap://:3268/OU=Offices,DC=company,DC=com?sAMAccountName?sub?(objectClass=person)”;

  29. Alpesh parmar

    // Hi Every buddy Following code is working perfectly for me

    DirectoryEntry entry = new DirectoryEntry(“LDAP://ldap.testathon.net:389/ou=Users,dc=testathon,dc=net”, “CN=stuart,OU=Users,DC=testathon,DC=net”, “stuart”, AuthenticationTypes.None);

    DirectorySearcher ds = new DirectorySearcher(entry);
    ds.SearchRoot = entry;

    using (SearchResultCollection results = ds.FindAll())
    foreach (SearchResult result in results)

    string name = (string)result.Properties[“OU”][0];


  30. TK

    Thanks! This is wonderful. I’m just learning how to work with LDAP in C# and the LDAP testing sight and posts from the readers have been VERY helpful!

Leave a Reply

Your email address will not be published. Required fields are marked *