NAME
Apache::AuthNetLDAP - mod_perl module that uses the Net::LDAP module for user authentication for Apache
SYNOPSIS
AuthName "LDAP Test Auth"
AuthType Basic
#only set the next two if you need to bind as a user for searching
#PerlSetVar BindDN "uid=user1,ou=people,o=acme.com" #optional
#PerlSetVar BindPWD "password" #optional
PerlSetVar BaseDN "ou=people,o=acme.com"
PerlSetVar LDAPServer ldap.acme.com
PerlSetVar LDAPPort 389
#PerlSetVar UIDAttr uid
PerlSetVar UIDAttr mail
require valid-user
PerlAuthenHandler Apache::AuthNetLDAP
DESCRIPTION
This module authenticates users via LDAP using the Net::LDAP module. This module is Graham Barr's "pure" Perl LDAP API.
It also uses all of the same parameters as the Apache::AuthPerLDAP, but I have added two extra parameters.
The parameters are:
- PerlSetVar BindDN
-
Used to set initial LDAP user.
- PerlSetVar BindPWD
-
Used to set initial LDAP password.
- PerlSetVar BaseDN
-
This sets the search base used when looking up a user in an LDAP server.
- PerlSetVar LDAPServer
-
This is the hostname of the LDAP server you wish to use.
- PerlSetVar LDAPPort
-
This is the port the LDAP server is listening on.
- PerlSetVar UIDAttr
-
The attribute used to lookup the user.
Uses for UIDAttr
For example if you set the UIDAttr to uid, then the LDAP search filter will lookup a user using the search filter:
Normally you will use the uid attribute, but you may want (need) to use a different attribute depending on your LDAP server or to synchronize with different applications. For example some versions of Novell's LDAP servers that I've encountered stored the user's login name in the cn attribute (a really bad idea). And the Netscape Address Book uses a user's email address as the login id.
INSTALLATION
It's a pretty straightforward install if you already have mod_perl and Net::LDAP already installed.
After you have unpacked the distribution type:
perl Makefile.PL make make test make install
Then in your httpd.conf file or .htaccess file, in either a <Directory> or <Location> section put:
AuthName "LDAP Test Auth"
AuthType Basic
#only set the next two if you need to bind as a user for searching
#PerlSetVar BindDN "uid=user1,ou=people,o=acme.com" #optional
#PerlSetVar BindPWD "password" #optional
PerlSetVar BaseDN "ou=people,o=acme.com"
PerlSetVar LDAPServer ldap.acme.com
PerlSetVar LDAPPort 389
PerlSetVar UIDAttr uid
require valid-user
PerlAuthenHandler Apache::AuthNetLDAP
If you don't have mod_perl or Net::LDAP installed on your system, then the Makefile will prompt you to
install each of these modules. At this time, June 6, 2003, you may say yes to Net::LDAP, and yes for
mod_perl, if you are installing this module on apache 1.3. (The reason being, that mod_perl 2 is under
development, and is not ready for download from CPAN at this time. Therefore, your install of mod_perl,
as initiated with the Makefile.PL, will fail. If you are going to install mod_perl 2, which is needed
to work with Apache2, you will need to download it from: http://perl.apache.org/download/index.html.
(Installation is beyond the scope of this document, but you can find documentation at:
http://perl.apache.org/docs/2.0/user/install/install.html#Installing_mod_perl_from_Source.)
Otherwise installation is the same.
You may also notice that the Makefile.PL will ask you to install ExtUtils::AutoInstall. This is
necessary for the installation process to automatically install any of the dependencies that you
are prompted for. You may choose to install the module, or not.
HOMEPAGE
Module Home: http://web2.unt.edu/apache_authnetldap/
AUTHOR Mark Wilcox mewilcox@unt.edu and Shannon Eric Peevey speeves@unt.edu
SEE ALSO Net::LDAP
ACKNOWLEDGMENTS
Graham Barr for writing Net::LDAP module.
Henrik Strom for writing the Apache::AuthPerLDAP module which I derived this from.
The O'Reilly "Programming Modules for Apache with Perl and C" (http://www.modperl.com).
Mark Wilcox for being the "Godfather" of Central Web Support... ;)
Stas Beckman for having the patience to answer my many questions.
Everyone else on the modperl mailing list... You know who you are :)
WARRANTY AND LICENSE
You can distribute and modify in accordance to the same license as Perl. Though I would like to know how you are using the module or if you are using the module at all.
Like most of the stuff on the 'net, I got this copy to work for me without destroying mankind, you're mileage may vary.