The options described in this document require EZproxy 3.0a GA (2004-08-02) through EZproxy 3.6.
LDAP was configured quite differently in older version of EZproxy. See Older LDAP Authentication for configuration information for older versions.
If your institution has not had a chance to review the EDUCAUSE/Internet2 eduPerson LDAP object class, OCLC would suggest you take a moment to review it at www.educause.edu/eduperson to consider the potential benefits. The use of multi-valued attributes such as eduPersonAffiliation and eduPersonScopedAffiliation as a method to deal mapping combinations of faculty, staff, students, alumni, etc., is quite powerful in its ability to be leveraged across many applications including EZproxy.
Your server's EZproxy Administration has a link titled "Test LDAP". This tool can be used to build your initial LDAP configuration. To use this tool with Active Directory, see LDAP Authentication with Active Directory for additional information.
LDAP authentication is configured by making entries in the user.txt/ezproxy.usr file. An LDAP entry in user.txt/ezproxy.usr takes this general form:
::LDAP
LDAPDirective
LDAPDirective
/LDAP The directives for LDAP may be divided into two groups: conditions and actions.
Conditions indicate tests that must be true if the current line is to be considered further. At the end of a condition, insert a semi-colon (;), then include another condition or one or more actions.
Actions direct EZproxy to perform specific tasks. Multiple actions may appear on the same line separated by semi-colons (;).
Directives whose descriptions start with [RARE] are provided for highly unusual configurations and will not be used by most users.
These are the conditions available and what they test:
These are the actions available:
ldap[s]:// host[: port]/ [root]? attribute? scope? filter The URL starts with either ldap for normal LDAP or ldaps for secure LDAP using SSL. host is the hostname of the LDAP server, which may be followed by an colon and optional port number. root is the root from which searching should occur. attribute is the LDAP attribute that should be used to find the user and is most commonly specified as uid, cn, or sAMAccountName. scope can be one (search only at the root location) or sub (search starting at the root location and the entire subtree below the specified root). filter is an LDAP filter to apply to the search such as (objectClass=person) to search for user objects only.
This example
::LDAP
URL ldap://ldap.yourlib.org/?uid?sub?(objectClass=person)
Unauthenticated; Stop
/LDAP
::LDAP
BindUser CN=ezproxy,CN=users,DC=yourlib,DC=org
BindPassword verysecret
URL ldap://ldapserv.yourlib.org/CN=users,DC=yourlib,DC=org?sAMAccountName?sub?(objectClass=person)
/LDAP
This example checks the user to see if the user has an attribute named eduPersonAffiliation with the value of student, faculty, employee, or staff, and if so, allows access. If the user has this attribute with a value of alum, EZproxy looks for the file alum.html in the docs subdirectory and sends that to the user, then denies access. If the user does not have this attribute or if the user has this attribute but with none of these values, EZproxy looks for the file other.html in the docs subdirectory and sends that to the user, then denies access.
::LDAP
URL ldap://ldapserv.yourlib.org/DC=yourlib,DC=org?uid?sub?(objectClass=person)
Unauthenticated; Stop
Test eduPersonAffiliation student; Stop
Test eduPersonAffiliation faculty; Stop
Test eduPersonAffiliation employee; Stop
Test eduPersonAffiliation staff; Stop
Test eduPersonAffiliation alum; Deny alum.html
Deny other.html
/LDAP
In this example, all authenticated users are placed in the EZproxy General group, and those users who are members of the LDAP CN=Law,CN=Users,DC=yourlib,DC=org group are also placed in the EZproxy Legal group.
::LDAP
BindUser CN=ezproxy,CN=users,DC=yourlib,DC=org
BindPassword verysecret
URL ldap://ldapserv.yourlib.org/CN=users,DC=yourlib,DC=org?sAMAccountName?sub?(objectClass=person)
Unauthenticated; Stop
Group General
Member CN=Law,CN=Users,DC=yourlib,DC=org; Group +Legal
/LDAP
Novell stores group memberships as attributes, so this example demonstrates checking LDAP group membership using Test with the groupMembership attribute.
::LDAP
URL ldaps://ldapserv.yourlib.org/OU=users,O=yourlib?uid?sub?(objectClass=person)
Unauthenticated; Stop
Group General
Test groupMembership CN=Health,OU=users,O=yourlib; Group +Medical
/LDAP
If your usernames or passwords contain extended characters (e.g., ä, ñ, ó), you will need to edit login.htm and loginbu.htm in the docs directory and add:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
immedaitely following the <head> tag to insure that these characters are encoded properly for authentication against LDAP.