From: Vincent Bray
Contents
Operation
The require Directives
The Require Directives
Examples
Using TLS
Using SSL
require
+ - Grant access if there is a
Require
valid-user
directive.
- - Grant access if there is a
require user
directive, and the
+ - Grant access if there is a
Require user
directive, and the
username in the directive matches the username passed by the
client.
- - Grant access if there is a
require
+ - Grant access if there is a
Require
dn
directive, and the DN in the directive matches
the DN fetched from the LDAP directory.
- - Grant access if there is a
require group
directive, and
+ - Grant access if there is a
Require group
directive, and
the DN fetched from the LDAP directory (or the username
passed by the client) occurs in the LDAP group.
- Grant access if there is a
-
require ldap-attribute
+ Require ldap-attribute
directive, and the attribute fetched from the LDAP directory
matches the given value.
@@ -238,7 +238,7 @@ for HTTP Basic authentication.
AuthLDAPURL
The attribute specified in the
- URL is used in compare operations for the require
+ URL is used in compare operations for the Require
user
operation.
@@ -246,14 +246,14 @@ for HTTP Basic authentication.
AuthLDAPCompareDNOnServer
Determines the behavior of the
- require dn
directive.
+ Require dn
directive.
AuthLDAPGroupAttribute
Determines the attribute to
- use for comparisons in the require group
+ use for comparisons in the Require group
directive.
@@ -262,19 +262,19 @@ for HTTP Basic authentication.
Specifies whether to use the
user DN or the username when doing comparisons for the
- require group
directive.
+ Require group
directive.
-The require Directives
+The Require Directives
Apache's Require
directives are used during the authorization phase to ensure that
a user is allowed to access a resource.
-require
+Require
valid-user
If this directive exists, mod_auth_ldap
grants
@@ -282,42 +282,42 @@ for HTTP Basic authentication.
search/bind phase.
-require user
+Require user
- The require user
directive specifies what
+
The Require user
directive specifies what
usernames can access the resource. Once
mod_auth_ldap
has retrieved a unique DN from the
directory, it does an LDAP compare operation using the username
- specified in the require user
to see if that username
+ specified in the Require user
to see if that username
is part of the just-fetched LDAP entry. Multiple users can be
granted access by putting multiple usernames on the line,
separated with spaces. If a username has a space in it, then it
must be surrounded with double quotes. Multiple users can also be
- granted access by using multiple require user
+ granted access by using multiple Require user
directives, with one user per line. For example, with a AuthLDAPURL
of
ldap://ldap/o=Airius?cn
(i.e., cn
is
- used for searches), the following require directives could be used
+ used for searches), the following Require directives could be used
to restrict access:
-require user "Barbara Jenson"
-require user "Fred User"
-require user "Joe Manager"
+Require user "Barbara Jenson"
+Require user "Fred User"
+Require user "Joe Manager"
Because of the way that mod_auth_ldap
handles this
directive, Barbara Jenson could sign on as Barbara
Jenson, Babs Jenson or any other cn
that
- she has in her LDAP entry. Only the single require
+ she has in her LDAP entry. Only the single Require
user
line is needed to support all values of the attribute
in the user's entry.
If the uid
attribute was used instead of the
cn
attribute in the URL above, the above three lines
could be condensed to
-require user bjenson fuser jmanager
+Require user bjenson fuser jmanager
-require group
+Require group
This directive specifies an LDAP group whose members are
allowed access. It takes the distinguished name of the LDAP
@@ -333,34 +333,34 @@ uniqueMember: cn=Fred User, o=Airius
The following directive would grant access to both Fred and
Barbara:
-require group cn=Administrators, o=Airius
+Require group cn=Administrators, o=Airius
Behavior of this directive is modified by the AuthLDAPGroupAttribute
and
AuthLDAPGroupAttributeIsDN
directives.
-require dn
+Require dn
- The require dn
directive allows the administrator
+
The Require dn
directive allows the administrator
to grant access based on distinguished names. It specifies a DN
that must match for access to be granted. If the distinguished
name that was retrieved from the directory server matches the
- distinguished name in the require dn
, then
+ distinguished name in the Require dn
, then
authorization is granted. Note: do not surround the distinguished
name with quotes.
The following directive would grant access to a specific
DN:
-require dn cn=Barbara Jenson, o=Airius
+Require dn cn=Barbara Jenson, o=Airius
Behavior of this directive is modified by the AuthLDAPCompareDNOnServer
directive.
-require ldap-attribute
+Require ldap-attribute
- The require ldap-attribute
directive allows the
+
The Require ldap-attribute
directive allows the
administrator to grant access based on attributes of the authenticated
user in the LDAP directory. If the attribute in the directory
matches the value given in the configuration, access is granted.
@@ -368,11 +368,11 @@ uniqueMember: cn=Fred User, o=Airius
The following directive would grant access to anyone with
the attribute employeeType = active
- require ldap-attribute employeeType=active
+ Require ldap-attribute employeeType=active
Multiple attribute/value pairs can be specified on the same line
separated by spaces or they can be specified in multiple
- require ldap-attribute
directives. The effect of listing
+ Require ldap-attribute
directives. The effect of listing
multiple attribute/values pairs is an OR operation. Access will be
granted if any of the listed attribute values match the value of a
corresponding attribute in the user object. If the value of the
@@ -381,7 +381,7 @@ uniqueMember: cn=Fred User, o=Airius
The following directive would grant access to anyone with
the city attribute equal to "San Jose" or status equal to "Active"
- require ldap-attribute city="San Jose" status=active
+ Require ldap-attribute city="San Jose" status=active
@@ -395,7 +395,7 @@ uniqueMember: cn=Fred User, o=Airius
AuthLDAPURL ldap://ldap1.airius.com:389/ou=People, o=Airius?uid?sub?(objectClass=*)
- require valid-user
+ Require valid-user
AuthLDAPURL ldap://ldap1.airius.com ldap2.airius.com/ou=People, o=Airius
-require valid-user
+Require valid-user
uid
.
AuthLDAPURL ldap://ldap.airius.com/ou=People, o=Airius?cn
-require valid-user
+Require valid-user
AuthLDAPURL ldap://ldap.airius.com/o=Airius?uid
-require group cn=Administrators, o=Airius
+Require group cn=Administrators, o=Airius
AuthLDAPURL ldap://ldap.airius.com/o=Airius?uid??(qpagePagerID=*)
-require valid-user
+Require valid-user
AuthLDAPURL ldap://ldap.airius.com/o=Airius?uid??(|(qpagePagerID=*)(uid=jmanager))
-require valid-user
+Require valid-user
This last may look confusing at first, so it helps to @@ -526,17 +526,17 @@ AuthLDAPFrontPageHack on
FrontPage restricts access to a web by adding the FrontPage restricts access to a web by adding the require
+
Require
valid-user
directive to the .htaccess
files. If AuthLDAPFrontPageHack
is not
- on, the require valid-user
directive will succeed for
+ on, the Require valid-user
directive will succeed for
any user who is valid as far as LDAP is
concerned. This means that anybody who has an entry in
the LDAP directory is considered a valid user, whereas FrontPage
considers only those people in the local user file to be
valid. The purpose of the hack is to force Apache to consult the
local user file (which is managed by FrontPage) - instead of LDAP
- - when handling the require valid-user
directive.Require valid-user
directive.
Once directives have been added as specified above, FrontPage users will be able to perform all management @@ -669,7 +669,7 @@ authenticating the user if this one fails
When set, mod_auth_ldap
will use the LDAP
server to compare the DNs. This is the only foolproof way to
compare DNs. mod_auth_ldap
will search the
- directory for the DN specified with the require dn
directive, then,
+ directory for the DN specified with the Require dn
directive, then,
retrieve the DN and compare it with the DN retrieved from the user
entry. If this directive is not set,
mod_auth_ldap
simply does a string comparison. It
diff --git a/docs/manual/mod/mod_auth_ldap.xml b/docs/manual/mod/mod_auth_ldap.xml
index 9648407ca82..1ead309b3de 100644
--- a/docs/manual/mod/mod_auth_ldap.xml
+++ b/docs/manual/mod/mod_auth_ldap.xml
@@ -74,14 +74,14 @@ for HTTP Basic authentication.
require
+ - Grant access if there is a
Require
valid-user
directive.
- Grant access if there is a
require user
directive, and the
+ href="#reqgroup">Require user
directive, and the
username in the directive matches the username passed by the
client.require
+ - Grant access if there is a
Require
dn
directive, and the DN in the directive matches
the DN fetched from the LDAP directory.
- Grant access if there is a
require group
directive, and
+ href="#reqgroup">Require group
directive, and
the DN fetched from the LDAP directory (or the username
passed by the client) occurs in the LDAP group.require ldap-attribute
+ Require ldap-attribute
directive, and the attribute fetched from the LDAP directory
matches the given value.require
+ URL is used in compare operations for the Require
user
operation.
require dn
directive.Require dn
directive.
require group
+ use for comparisons in the Require group
directive.require group
directive.Require group
directive.
-Apache's
If this directive exists,
The require user
directive specifies what
+
The Require user
directive specifies what
usernames can access the resource. Once
require user
to see if that username
+ specified in the Require user
to see if that username
is part of the just-fetched LDAP entry. Multiple users can be
granted access by putting multiple usernames on the line,
separated with spaces. If a username has a space in it, then it
must be surrounded with double quotes. Multiple users can also be
- granted access by using multiple require user
+ granted access by using multiple Require user
directives, with one user per line. For example, with a ldap://ldap/o=Airius?cn
(i.e., cn
is
- used for searches), the following require directives could be used
+ used for searches), the following Require directives could be used
to restrict access:
Because of the way that cn
that
- she has in her LDAP entry. Only the single require
+ she has in her LDAP entry. Only the single
Require
user
line is needed to support all values of the attribute
in the user's entry.
If the uid
attribute was used instead of the
cn
attribute in the URL above, the above three lines
could be condensed to
This directive specifies an LDAP group whose members are
allowed access. It takes the distinguished name of the LDAP
@@ -316,7 +316,7 @@ uniqueMember: cn=Fred User, o=Airius
The following directive would grant access to both Fred and Barbara:
-Behavior of this directive is modified by the
directives.
The require dn
directive allows the administrator
+
The Require dn
directive allows the administrator
to grant access based on distinguished names. It specifies a DN
that must match for access to be granted. If the distinguished
name that was retrieved from the directory server matches the
- distinguished name in the require dn
, then
+ distinguished name in the Require dn
, then
authorization is granted. Note: do not surround the distinguished
name with quotes.
The following directive would grant access to a specific DN:
-Behavior of this directive is modified by the
The require ldap-attribute
directive allows the
+
The Require ldap-attribute
directive allows the
administrator to grant access based on attributes of the authenticated
user in the LDAP directory. If the attribute in the directory
matches the value given in the configuration, access is granted.
The following directive would grant access to anyone with the attribute employeeType = active
-Multiple attribute/value pairs can be specified on the same line
separated by spaces or they can be specified in multiple
- require ldap-attribute
directives. The effect of listing
+ Require ldap-attribute
directives. The effect of listing
multiple attribute/values pairs is an OR operation. Access will be
granted if any of the listed attribute values match the value of a
corresponding attribute in the user object. If the value of the
@@ -367,7 +367,7 @@ uniqueMember: cn=Fred User, o=Airius
The following directive would grant access to anyone with the city attribute equal to "San Jose" or status equal to "Active"
-uid
.
This last may look confusing at first, so it helps to
@@ -517,18 +517,18 @@ AuthLDAPFrontPageHack on
FrontPage restricts access to a web by adding the FrontPage restricts access to a web by adding the Once directives have been added as specified above,
FrontPage users will be able to perform all management
@@ -666,7 +666,7 @@ authenticating the user if this one fails
server to compare the DNs. This is the only foolproof way to
compare DNs. require
+
Require
valid-user
directive to the .htaccess
files. If require valid-user
directive will succeed for
+ on, the Require valid-user
directive will succeed for
any user who is valid as far as LDAP is
concerned. This means that anybody who has an entry in
the LDAP directory is considered a valid user, whereas FrontPage
considers only those people in the local user file to be
valid. The purpose of the hack is to force Apache to consult the
local user file (which is managed by FrontPage) - instead of LDAP
- - when handling the require valid-user
directive.Require valid-user
directive.require dn
directive, then,
+ href="#reqdn">Require dn
directive, then,
retrieve the DN and compare it with the DN retrieved from the user
entry. If this directive is not set,