May 162013

I recently ran into an issue configuring HTTP Basic authentication against Active Directory using Apache httpd.  What was happening was that I’d get a 500 Internal Server Error page every time I hit a location that required Basic authentication.  There wasn’t anything useful in the logs, and I started playing around with the configuration (which, I must point out, was correct in a way).  After about two hours of trial I finally figured out the problem — there appears to be some sort of bug either in the OpenLDAP libraries, Apache httpd, or Active Directory itself, when Apache was trying to connect to AD via LDAP.  I found this only appeared when I had my search base configured to be the top-level DN of my Active Directory.  Changing the search base to an OU lower also resolved the problem, but I couldn’t do that because I have users across several OU’s off the top of the DIT.  The solution I came up with was to connect to port 3268, the Global Catalog, rather than the normal port of 389.

Here’s my mod_authnz_ldap configuration settings:

Hope that helps!

Feb 022013

A new version of AuthLDAP has been released and is ready for consumption.  I’ve put in some more error checking and tried to fix some of the bugs around the group membership checking for users.  I’ve also done some major reworking of the configuration options in order to hopefully allow for better interoperability between directories and to add options that can help with search optimization in some cases.

This has been tested against Active Directory, OpenLDAP, and SunOne Directory Server.  You can download the new library from it’s project page.  I hope you find it useful!

Jul 182012

It’s been a while since I left you with my last pearl of wisdom.  A couple months ago, I presented a couple methods for authenticating to Active Directory using winbind and for authenticating using the LDAP interface.  In more recent versions of CentOS and RHEL, there is a new method for retriving user information and authenticating – SSS, the System Security Service, which runs as sssd.  SSS was devised by Red Hat as a replacement for the various nss and PAM modules and it seems like they did a halfway decent job with it.

SSS acts as a replacement for the various PADL, Samba winbind, and other ldap and AD based pam and nss modules.  In addition to consolidating several nss and authentication types, there are a couple other advantages, including one unified configuration file and offline authentication, as well as access control.

Continue reading »

Dec 302011

A while back, I described a method for authenticating CentOS and RHEL servers to Active Directory using LDAP.  While this approach is easy to set up and works right out of the gate, there are a few drawbacks to it that I’ve run across:

  • Changing passwords from the Linux server does not work unless you set up LDAP over TLS/SSL, which I’ve found very difficult (though not impossible!) to accomplish
  • While changing the passwords does work, it can be very user unfriendly.  In particular error messages given are very cryptic to the lay user.  Unless you are in IT, you’re not going to know or care about the LDAP error codes that are reported back, nor are you going to want to research what the appropriate character classes are for the AD passwords so that you can choose from at least three of them appropriately.

In this article, I’ll describe how to use winbind to join your Linux server to a Microsoft Active Directory and become a domain member.

Continue reading »

Sep 212011

For the past few weeks, I’ve been spinning my wheels trying to get CentOS 6 to use Active Directory (Windows 2008 R2-based) for user information and authentication. I currently am using LDAP for these purposes, but in the interest of moving towards a more centralized environment am working towards having all of the UNIX and Linux hosts use AD as a central repository for user information and authentication. This is can be done relatively easily and can be done a couple of different ways that I will outline for you here.

Continue reading »

Jul 032011

Over the past couple years, I’ve written several little php-based application that rely on LDAP for authentication.  More recently, I’ve been using CodeIgniter to write more apps.  I thought it was about time to handle LDAP authentication a little more elegantly.  To handle this, I’ve written a library for CodeIgniter called Ldap_Auth.

Continue reading »