]> git.pld-linux.org Git - packages/apache-mod_auth_mysql.git/blame - mysql-group-auth.txt
a2ed9bc0060f2015361dffe8d8b724e9 mysql-group-auth.txt
[packages/apache-mod_auth_mysql.git] / mysql-group-auth.txt
CommitLineData
06f52359 1This document describes how to use group-based authorization using my
2version of mod_auth_mysql.c. This version is based heavily on my own
3version of mod_auth_msql.c, which was widely distributed prior to the
4one currently shipped with Apache.
5
6There are two options to using groups. You can put the "user_group"
7field into the same table as the user database if each user is in only
8one group, or you can have a separate table that contains the fields
9"user_name" and "user_group" if each user is a member of multiple
10groups.
11
12If the user_group field is part of the full user table, the table has
13three fields at least: user_name, user_group, user_passwd. The
14user_group field must be "PRIMARY KEY" in the user database containing
15a password. The htaccess file would be this:
16
17AuthName My Authorization
18AuthType Basic
19AuthGroupFile /dev/null
20AuthMySQLHost localhost
21AuthMySQLDB authdata
22AuthMySQLUserTable user_info
23AuthMySQLGroupField user_group
24require group admin
25
26If you have a separate database for groups, the two tables would be
27
28user_info: user_name, user_passwd (user_name must be PRIMARY KEY)
29user_group: user_name, user_group (user is not PRIMARY KEY, as we have
30 multiple tuples for user_name,user_group to let a user be in
31 multiple groups)
32
33and htaccess would have this:
34
35AuthName My Authorzation
36AuthType Basic
37AuthGroupFile /dev/null
38AuthMySQLHost localhost
39AuthMySQLDB authdata
40AuthMySQLUserTable user_info
41
42AuthMySQLGroupTable my_groups
43AuthMySQLGroupField user_group
44require group admin
45
46
47
48Assuming that the required group name is "admin".
This page took 0.038054 seconds and 4 git commands to generate.