March 16, 2014

HTTP Configure LDAP-Based Authentication

In my previous blog I showed you how to set up basic authentication via access file for a private directory. To do the same thing for LDAP, use this configuration instead.

LoadModule authnz_ldap_module modules/mod_authnz_ldap.so

LDAPTrustedGlobalCert CA_BASE64 /etc/httpd/example-ca.crt

<Directory "/private">
    AuthType Basic
    AuthName "Restricted Resource"
    AuthBasicProvider ldap
    AuthLDAPUrl "ldap://ldap.example.com/dc=example,dc=com" TLS
    Require valid-user
    Order deny,allow
    Deny from all
    Allow from all
</Directory>

Reference

http://httpd.apache.org/docs/2.2/mod/mod_authnz_ldap.html

No comments: