This article only deals with version 1.3 and later. To view and discuss issues pertaining to version 1.2 and prior, click here.

Integrating WordPress with LDAP shouldn’t be difficult. Now it isn’t.

Simple LDAP Login provides the features you need with the simple configuration you want. It has everything you need to get started today.

Features
  • Supports Active Directory and OpenLDAP (and other directory systems which comply to the LDAP standard, such as OpenDS)
  • Supports TLS
  • Uses up-to-date methods for WordPress 3+ authentication routines.
  • Includes three login modes:
    • Normal Mode: Authenticates existing wordpress usernames against LDAP. This requires you to create all WordPress accounts manually using the same usersnames as those in your LDAP directory.
    • Account Creation Mode 1: Creates WordPress accounts automatically for any LDAP user.
    • Account Creation Mode 2: Creates WordPress accounts automatically for LDAP users in a specific Group you specify.
  • Intuitive control panel.
Architecture

Simple LDAP Login adds an authentication filter to WordPress that authentication requests must pass. In doing so, it makes several decisions.

  • Can the provided credentials be authenticated against LDAP?
    • If so, is the username a valid WP username?
      • If not, can we create a WP user?
        • If we can, does the user belong to the right (if any) group?
          • If the user does, create the WordPress user and log the user in.
    • If the username is already valid wordpress user, are they in the right group?
      • Is so, log the user in.

This is simply a high level overview. The actual logic the plugin employs is more complex, but hopefully this gives you an idea, philosophically, about how the plugin accomplishes what it does.

Installation
  1. Use the WordPress plugin directory to install the plugin or upload the directory “simple-ldap-login” to the `/wp-content/plugins/` directory
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Immediately update the settings to those that best match your environment by going to Settings -> Simple LDAP Login
  4. If you don’t get the settings right the first time…don’t fret! Just use your wordpress credentials…they will always work in low security mode.
  5. Once you have the settings correct, you can change the security mode to High Security (if you so desire).
  6. To make your life easier, consider using two different browsers (e.g., IE and Firefox) to do testing.  Change settings in one. Test in the other. This will prevent any chance of being locked out.

Control panel.

Frequently Asked Questions
Other than WordPress, what does my system require?

If you are using Active Directory, you will probably need PHP 5. This is because I’m using adLDAP 3.0 to do my Active Directory integration. As far as I know, the rest of the code should work with PHP 4. It is also possible that the functionality I’m using with adLDAP 3.0 does not depend directly on PHP 5. Your mileage may vary.

Other than that, it is imperative that your installation of PHP be compiled with LDAP. Without it you may see errors referencing undefined functions like “ldap_connect”.  You can view more information about PHP and LDAP here.

How do I know what the correct settings are?

I have tried to make the settings as self-explanatory as possible. If you are struggling figuring them out, you may need to speak with your LDAP administrator. I realize this is an obnoxious response, but there is no good, fail proof way to help you discover these settings. A good place to start, if you’re feeling daring, might be to use ADSIEdit for Windows and Active Directory, or GQ for Linux and OpenLDAP.

It’s still not working, what other things can I try?

If you are confident your settings are correct and it still does not work, it may be time to check for port or firewall issues. If your LDAP server is running on a non-standard port or an obsolete version of the LDAP protocol you are going to have issues. Port 389 is the port this plugin, and nearly every other LDAP enabled software expects. They are also expecting protocol version 3. If you are using an old version of LDAP or running a non-standard port you may need to modify the code that the plugin runs or update your LDAP installation.

Unfortunately I can’t be relied upon to assist with these types of requests. I chose not to support these scenarios because they are infrequent and because they confuse everyone else.

I took all of your advice, it’s still not working!

Post your question in the comments below, or e-mail me: me[at]clifgriffin.com

I’ll do my best to get you up and running!

How can I donate?

If you would like to donate to this project, please visit the donations page.

Download Now – Updated 9/09/2010

Click here to download Simple LDAP Login 1.4.0.1 from the WordPress plugin directory.