-
Notifications
You must be signed in to change notification settings - Fork 14
UpgradeToNZ
If you are upgrading from mod_auth_external
to mod_authnz_external
then it may help to start by reading the page describing the Apache Authn/z Architecture.
After that:
-
Make sure
mod_auth_external
is no longer being loaded. You cannot load bothmod_auth_external
andmod_authnz_external
without problems. This means ensuring that there is no "LoadModule
" or "AddModule
" line formod_auth_external
. You could also remove themod_auth_external.so
file from the Apache 'modules' directory.
-
Install
mod_authnz_external
as described on the Installation page.
-
The server-level configuration directives in the
httpd.conf
file can be left unchanged. The "AddExternalAuth
", "AddExternalGroup
", "SetExternalAuthMethod
", and "SetExternalGroupMethod
" commands still work work the same way as before. There was, however, a new, more compact alternate syntax was introduced in version 3.2.0 which can be used instead.
-
In the per-directory configurations (either in
.htaccess
files or in a<Directory>
block inhttpd.conf
) need to include a new directive to tellmod_auth_basic
to usemod_authnz_external
for authentication. Formod_auth_external
, the per-directory configurations normally looked something this:
AuthType Basic
AuthName <authname>
AuthExternal <keyword>
require valid-user
For mod_authnz_external, you need to add the "
AuthBasicProvider
" directive.AuthType Basic
AuthName <authname>
AuthBasicProvider external
AuthExternal <keyword>
require valid-user
The directive "
AuthType Basic
" tells Apache that you want to use themod_auth_basic
module to do "basic authentiation". The directive "AuthBasicProvider external
" tellsmod_auth_basic
to usemod_authnz_external
to check the correctness of passwords.
Note that the "AuthBasicProvider
" directive is only needed if you are usingmod_authnz_external
for password checking. If you are using it only for group checking, then this is not needed. -
If you were using mod_auth_external in a non-authoritative mode, then your per-directory configuration probably included the directive:
AuthExternalAuthoritative off
This command will no longer work. Instead you should use one or both of the following commands:
AuthBasicAuthoritative off
GroupExternalAuthoritative off
The "
AuthBasicAuthoritativ
e" directive effects password checking, which is done throughmod_auth_basic
.
The "GroupExternalAuthoritative
" effects only group checking. That is if you had both "GroupExternal
" directive setting up an external program for group checking, and an "AuthGroupFile
" directive setting up a group file, then it would control whether the first module to process a "Require group admin
" directive was the only one to run, or whether each group checker was given a chance to decide if the user was in that group based on it's group database. -
If you were using multiple Require directives, the behavior may change under Apache 2.2. Suppose you wanted to allow access to user "
pete
" and members of the group "admins
". You might have do:
Under Apache 2.0, both of these directives would have been checked byRequire group admin
Require user pete
mod_auth_external
, and it would have correctly allowed access if either of the two conditions were satisfied. In Apache 2.2, however, only "Require group
" and "Require file-group
" directives are checked bymod_authnz_external
. "Require user
" and "Require valid-user
" are checked bymod_authz_user
, a standard module that comes with Apache. How the two directives interact depends on whether they are authoritative or not.mod_authz_user
is Authoritative by default, so to get the old behavior, you will need to do
GroupUserAuthoritative off
-
Note that a new type of functionality is available under Apache 2.2 with
mod_authnz_external
. Thanks tomod_authz_owner
, you can now do:
orRequire file-owner
Require file-group
The first checks if the name of the authenticated user matches the name of the unix account that owns the file. The second checks if, according to whatever group database has been configured for the current directory, the currently authenticated user is in a group with the same name as the Unix group that owns the file.
Normally these are rather strange directives, because normally unix accounts have no relationship to accounts in whatever database is being used for http authentication, but for people using 'pwauth
' withmod_authnz_external
, these really check if the user has been authenticated as the unix user who owns the file.
- List of Available Authenticators
- Historical License and Version Notes
- A Brief Explanation of the Apache Authn/z Architecture
- Links to Related Software
- Ideas for Future Improvements to Mod_authnz_external