<-
Apache > HTTP Сервер > Документация > Версия 2.2 > Модули

Apache Module mod_authn_anon

Описание:Allows "anonymous" user access to authenticated areas
Статус:Extension
Идентификатор модуля:authn_anon_module
Исходный файл:mod_authn_anon.c
Совместимость:Available in Apache 2.1 and later

Summary

This module provides authentication front-ends such as mod_auth_basic to authenticate users similar to anonymous-ftp sites, i.e. have a 'magic' user id 'anonymous' and the email address as a password. These email addresses can be logged.

Combined with other (database) access control methods, this allows for effective user tracking and customization according to a user profile while still keeping the site open for 'unregistered' users. One advantage of using Auth-based user tracking is that, unlike magic-cookies and funny URL pre/postfixes, it is completely browser independent and it allows users to share URLs.

When using mod_auth_basic, this module is invoked via the AuthBasicProvider directive with the anon value.

top

Пример

The example below is combined with "normal" htpasswd-file based authentication and allows users in additionally as 'guests' with the following properties:

  • It insists that the user enters a userID. (Anonymous_NoUserID)
  • It insists that the user enters a password. (Anonymous_MustGiveEmail)
  • The password entered must be a valid email address, i.e. contain at least one '@' and a '.'. (Anonymous_VerifyEmail)
  • The userID must be one of anonymous guest www test welcome and comparison is not case sensitive. (Anonymous)
  • And the Email addresses entered in the passwd field are logged to the error log file. (Anonymous_LogEmail)

Пример

<Directory /foo> AuthName "Use 'anonymous' & Email address for guest entry"
AuthType Basic
AuthBasicProvider file anon
AuthUserFile /path/to/your/.htpasswd

Anonymous_NoUserID off
Anonymous_MustGiveEmail on
Anonymous_VerifyEmail on
Anonymous_LogEmail on
Anonymous anonymous guest www test welcome

Order Deny,Allow
Allow from all

Require valid-user
</Directory>

top

Anonymous Директива

Описание:Specifies userIDs that are allowed access without password verification
Синтаксис:Anonymous user [user] ...
Контекст:directory, .htaccess
Перекрывает:AuthConfig
Статус:Extension
Модуль:mod_authn_anon

A list of one or more 'magic' userIDs which are allowed access without password verification. The userIDs are space separated. It is possible to use the ' and " quotes to allow a space in a userID as well as the \ escape character.

Please note that the comparison is case-IN-sensitive.
It's strongly recommended that the magic username 'anonymous' is always one of the allowed userIDs.

Пример:

Anonymous anonymous "Not Registered" "I don't know"

This would allow the user to enter without password verification by using the userIDs "anonymous", "AnonyMous", "Not Registered" and "I Don't Know".

As of Apache 2.1 it is possible to specify the userID as "*". That allows any supplied userID to be accepted.

top

Anonymous_LogEmail Директива

Описание:Sets whether the password entered will be logged in the error log
Синтаксис:Anonymous_LogEmail On|Off
По умолчанию:Anonymous_LogEmail On
Контекст:directory, .htaccess
Перекрывает:AuthConfig
Статус:Extension
Модуль:mod_authn_anon

When set On, the default, the 'password' entered (which hopefully contains a sensible email address) is logged in the error log.

top

Anonymous_MustGiveEmail Директива

Описание:Specifies whether blank passwords are allowed
Синтаксис:Anonymous_MustGiveEmail On|Off
По умолчанию:Anonymous_MustGiveEmail On
Контекст:directory, .htaccess
Перекрывает:AuthConfig
Статус:Extension
Модуль:mod_authn_anon

Specifies whether the user must specify an email address as the password. This prohibits blank passwords.

top

Anonymous_NoUserID Директива

Описание:Sets whether the userID field may be empty
Синтаксис:Anonymous_NoUserID On|Off
По умолчанию:Anonymous_NoUserID Off
Контекст:directory, .htaccess
Перекрывает:AuthConfig
Статус:Extension
Модуль:mod_authn_anon

When set On, users can leave the userID (and perhaps the password field) empty. This can be very convenient for MS-Explorer users who can just hit return or click directly on the OK button; which seems a natural reaction.

top

Anonymous_VerifyEmail Директива

Описание:Sets whether to check the password field for a correctly formatted email address
Синтаксис:Anonymous_VerifyEmail On|Off
По умолчанию:Anonymous_VerifyEmail Off
Контекст:directory, .htaccess
Перекрывает:AuthConfig
Статус:Extension
Модуль:mod_authn_anon

When set On the 'password' entered is checked for at least one '@' and a '.' to encourage users to enter valid email addresses (see the above Anonymous_LogEmail).

    Поддержать сайт на родительском проекте КГБ