When used with Apache, the SP includes an Access Control plugin implemented on top of the Apache Require authorization command. The placement rules for this command are dictated by Apache, and include its <Directory>, <File>, and <Location> blocks, as well as .htaccess files. By default, any place you can apply the Require command will trigger the Access Control implementation supplied with the SP's Apache module.

Make sure that any user will have already established a session, or require a session for the same path, or any access attempt will result in a 403.

.htaccess directives are able to override <Directory> blocks, but they cannot override <Location> blocks. If your .htaccess rules appear not to be executing, check for conflicting directives in the rest of Apache's configuration.

General Syntax

The general syntax of a Require rule is:

Require rule-type value1 value2

Some of the rule types support a regular expression mode:

Require rule ~ exp1 exp2

Rule Types

The SP supports the following rule "types" (the type is the first parameter of the command):

Rule Modifiers

A pair of rule modifiers are supported to affect the processing of the rule types that accept parameters (all but the first two above). Modifiers are placed after the rule type but before any comparison values.

The two modifiers can be combined, so as to enforce a regular expression that must NOT match. When using both modifiers, be sure to separate them with a space (see examples).

Rule and Module Combinations

Apache 2.4

As of Apache V2.4, authorization rules are designed to be handled by specific modules that register for them. With this change, the notion of combining rules from different modules is a first-order concept using a feature called authorization containers. This renders the commands described below obsolete and they are no longer supported.

Apache 1.3 - 2.2

Prior to Apache V2.4. the server functions by allowing access if any rule is satisfied. This allows rules recognized by different modules to appear, since modules can ignore rules they don't understand and simply grant access on their own, but limits the kinds of combinations possible.

The SP module includes a ShibRequireAll command that changes this semantic and requires that all rules present be satisfied before granting access. This is straightforward as long as all the rules are known to the SP module, but becomes complex if other modules are involved.

To control this behavior, the AuthzShibAuthoritative command is supplied. The following matrix describes how the options interact when an unrecogized rule is found:

 

AuthzShibAuthoritative On

AuthzShibAuthoritative Off

ShibRequireAll On

Access Denied

Decision Left to Other Modules

ShibRequireAll Off

Ignored

Ignored

Recommended Practices for Compatibility

The following are suggested steps to take to avoid work in the future:

The soonest changes would be made to remove deprecated options is in a V3.0 release of the SP, and there are no current plans for that. However the various combinations and issues are quite complex due to the software's age, so avoiding all this is the best option.

Examples

# Direct comparison
Require shib-attr affiliation student@osu.edu student@psu.edu

# Using an expression
Require shib-attr affiliation ~ ^student@(osu|psu)\.edu$
Require shib-user ! ~ ^.+@(osu|psu)\.edu$