| If you fall.. | PmWiki »
Auth User |
|
Deep dependencies
|
AuthUser is PmWiki's identity-based authorization system that allows access to pages to be controlled through the use of usernames and passwords. AuthUser can be used in addition to the password-based scheme that is PmWiki's default configuration.
AuthUser is a very flexible system for managing access control on pages, but flexibility can also bring complexity and increased maintenance overhead to the wiki administrator. This is why PmWiki defaults to the simpler password-based system. For some thoughts about the relative merits of the two approaches, see PmWiki:ThoughtsOnAccessControl.
Activating AuthUser
To activate PmWiki's identity-based system, add the following line
Creating user accounts
Most of AuthUser's configuration is performed via the Site.AuthUser page. To change the AuthUser configuration, simply edit this page like any other wiki page (you'll typically need to use the site's admin password for this).
To create a login account, simply add lines to Site.AuthUser that look like:
For example, to create a login account for "alice" with a password of "wonderland", enter:
When the page is saved, the "
For greater security, place a read password on the Site.AuthUser page.
To change or reset an account's password, simply replace the encrypted string with another
Controlling access to pages by login
Pages and groups can be protected based on login account by using "passwords" of the form
It's possible to use multiple "id:" declarations and passwords in the
To allow access to anyone that has successfully logged in, use "
One can also perform site-wide restrictions based on identity in the
You can change the
Organizing accounts into groups
AuthUser also makes it possible to group login accounts together into authorization groups, indicated by a leading "@" sign. As with login accounts, group memberships are maintained by editing the Site.AuthUser page. Group memberships can be specified by either listing the groups for a login account (person belongs to groups) or the login accounts for a group (group includes people). You can repeat or mix-and-match the two kinds as desired:
Then, to restrict page access to a particular group, simply use "
Excluding individuals from password groups
Group password memberships are maintained by editing the Site.AuthUser page. To specify a password group that allows access to anyone who is authenticated, you can specify:
If you need to keep "Fred" out of this password group, you might try:
... but this does not work. You can, however, get the desired result by using the first setting (@wholeoffice: *) on the Site.AuthUser page and then setting the password for the page or group you wish to protect in
Getting account names and passwords from external sources
The AuthUser script has the capability of obtaining username/password pairs from places other than the Site.AuthUser page, such as passwd-formatted files (usually called '.htpasswd' on Apache servers), LDAP servers, or even the local/config.php file.
Passwd-formatted files (.htpasswd/.htgroup)
Passwd-formatted files, commonly called .htpasswd files in Apache, are text files where each line contains a username and an encrypted password separated by a colon. A typical .htpasswd file might look like:
To get AuthUser to obtain usernames and passwords from a .htaccess file, add the following line to Site.AuthUser, replacing "/path/to/.htpasswd" with the filesystem path of the .htpasswd file:
Creation and maintenance of the .htpasswd file can be performed using a text editor, or any number of other third-party tools available for maintaining .htpasswd files. The Apache web server typically includes an htpasswd command for creating accounts in .htpasswd:
Similarly, one can use .htgroup formatted files to specify group memberships. Each line has the name of a group (without the "@"), followed by a colon, followed by a space separated list of usernames in the group.
Note that the groups are still "@writers", "@editors", and "@admins" in PmWiki even though the file doesn't specify the @ signs. To get AuthUser to load these groups, use a line in Site.AuthUser like:
Configuration via local/config.php
AuthUser configuration settings can also be made from the local/config.php file in addition to the Site.AuthUser page. Such settings are placed in the $AuthUser array, and must be set prior to including the authuser.php script. Some examples:
Configuration via LDAP
Authentication can be performed via an external LDAP server -- simply set an entry for "ldap" in either Site.AuthUser or the local/config.php file.
LDAP authentication in AuthUser closely follows the model used by Apache 2.0's mod_auth_ldap module; see especially the documentation for AuthLDAPUrl for a description of the url format.
For servers that don't allow anonymous binds, AuthUser provides
Setting the Author NameBy default, PmWiki will use a login name in the Author field of the edit form, but allows the author to change this value prior to saving. To force the login name to always be used as the author name, use the following sequence to activate AuthUser:
See Also
<< Passwords administration | Documentation Index | Uploads administration >>
|
| Page last modified on September 06, 2006, at 05:43 PM EST |