Dealing with spaces in LDAP URI's used with Apache
I had an Apache web server that I wanted to configure to use LDAP authentication for
controlling access to some pages. The LDAP directory already existed, in the form
of the company's Active Directory. Unfortunately, the company's two-word name was
part of the URI. This was not difficult to deal with when using command-line tools
such as ldeapsearch, because the DN could be placed in quotes. But this syntax doesn't
work in Apache's httpd.conf. The key turned out to be using %20 to represent the space
between the two words, like so:
This syntax was used in section 2.5.1 in a
document on PubCookie which also looks very interesting. Here's the complete LDAP section of
AuthName "Restricted Area"
AuthLDAPBindDN "cn=Recipients,ou=Edina,o=Acme Manufacturing"
I must point out, however, that using the above code, I could not get LDAP authentication from AD to work. When
I pointed it a Sun LDAP server, it worked fine.
Special thanks to my
friend Pete Palmer for finding the answer about the spaces