~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/auth_schema/docs/index.rst

  • Committer: Mark Atwood
  • Date: 2011-10-08 04:50:51 UTC
  • mfrom: (2430.1.1 rf)
  • Revision ID: me@mark.atwood.name-20111008045051-6ha1qiy7k2a9c3jv
Tags: 2011.10.27
mergeĀ lp:~olafvdspek/drizzle/refactor2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
.. _auth_schema_plugin:
2
 
 
3
 
Schema Authentication
4
 
=====================
5
 
 
6
 
:program:`auth_schema` is an authentication plugin that authenticates
7
 
connections using a MySQL-like table with SHA1 password hashes.  Unlike
8
 
MySQL, the auth table is not built-in and there are no default or anonymous
9
 
users.  Since a user must authenticate to create the auth table but no
10
 
users can authenticate until the auth table is created, this circular
11
 
dependency is resolved by temporarily using another authentication plugin.
12
 
See the :ref:`auth_schema_examples`.
13
 
 
14
 
.. note::
15
 
 
16
 
   Unload the :doc:`/plugins/auth_all/index` plugin before using this plugin.
17
 
 
18
 
.. seealso:: :doc:`/administration/authentication` 
19
 
 
20
 
.. _auth_schema_loading:
21
 
 
22
 
Loading
23
 
-------
24
 
 
25
 
To load this plugin, start :program:`drizzled` with::
26
 
 
27
 
   --plugin-add=auth_schema
28
 
 
29
 
Loading the plugin may not enable or configure it.  See the plugin's
30
 
:ref:`auth_schema_configuration` and :ref:`auth_schema_variables`.
31
 
 
32
 
.. seealso:: :ref:`drizzled_plugin_options` for more information about adding and removing plugins.
33
 
 
34
 
.. _auth_schema_configuration:
35
 
 
36
 
Configuration
37
 
-------------
38
 
 
39
 
These command line options configure the plugin when :program:`drizzled`
40
 
is started.  See :ref:`command_line_options` for more information about specifying
41
 
command line options.
42
 
 
43
 
.. program:: drizzled
44
 
 
45
 
.. option:: --auth-schema.table ARG
46
 
 
47
 
   :Default: ``auth.users``
48
 
   :Variable: :ref:`auth_schema_table <auth_schema_table>`
49
 
 
50
 
   Schema-qualified table with ``user`` and ``password`` columns.  Quoting the auth table
51
 
   in backticks is optional.  The auth table name can only contain one period between the
52
 
   schema name and the table name.
53
 
 
54
 
.. _auth_schema_variables:
55
 
 
56
 
Variables
57
 
---------
58
 
 
59
 
These variables show the running configuration of the plugin.
60
 
See `variables` for more information about querying and setting variables.
61
 
 
62
 
.. _auth_schema_enabled:
63
 
 
64
 
* ``auth_schema_enabled``
65
 
 
66
 
   :Scope: Global
67
 
   :Dynamic: Yes
68
 
   :Option:
69
 
 
70
 
   If :program:`auth_schema` is enabled or disabled.  If the plugin is
71
 
   disabled, all authentication is denied.
72
 
 
73
 
.. _auth_schema_table:
74
 
 
75
 
* ``auth_schema_table``
76
 
 
77
 
   :Scope: Global
78
 
   :Dynamic: Yes
79
 
   :Option: :option:`--auth-schema.table`
80
 
 
81
 
   Schema-qualified table with ``user`` and ``password`` columns.
82
 
 
83
 
.. _auth_schema_examples:
84
 
 
85
 
Examples
86
 
--------
87
 
 
88
 
Start Drizzle with the default :doc:`/plugins/auth_all/index` plugin and
89
 
create the initial auth schema and table:
90
 
 
91
 
.. code-block:: mysql
92
 
 
93
 
   CREATE SCHEMA auth;
94
 
   USE auth;
95
 
   CREATE TABLE users (
96
 
      user     VARCHAR(255) NOT NULL,
97
 
      password VARCHAR(40),
98
 
      UNIQUE INDEX user_idx (user)
99
 
   );
100
 
 
101
 
Create a user account called ``susan`` with password ``herpass``:
102
 
 
103
 
.. code-block:: mysql
104
 
 
105
 
   INSERT INTO auth.users (user, password) VALUES ('susan', MYSQL_PASSWORD('herpass'));
106
 
 
107
 
Restart Drizzle with just the :program:`auth_schema` plugin:
108
 
 
109
 
.. code-block:: bash
110
 
 
111
 
   bin/drizzled --shutdown
112
 
   sbin/drizzled               \
113
 
      --plugin-remove=auth_all \
114
 
      --plugin-add=auth_schema
115
 
 
116
 
Test that it works:
117
 
 
118
 
.. code-block:: bash
119
 
 
120
 
   $ drizzle
121
 
   ERROR 1045 (28000): Access denied for user 'daniel' (using password: NO)
122
 
 
123
 
   $ drizzle --user susan
124
 
   ERROR 1045 (28000): Access denied for user 'susan' (using password: NO)
125
 
 
126
 
   $ drizzle --user susan --password=wrongpass
127
 
   ERROR 1045 (28000): Access denied for user 'susan' (using password: YES)
128
 
 
129
 
   $ drizzle --user=susan --password=herpass
130
 
   Welcome to the Drizzle client..  Commands end with ; or \g.
131
 
   ...
132
 
 
133
 
.. _auth_schema_authors:
134
 
 
135
 
Authors
136
 
-------
137
 
 
138
 
Daniel Nichter
139
 
 
140
 
.. _auth_schema_version:
141
 
 
142
 
Version
143
 
-------
144
 
 
145
 
This documentation applies to **auth_schema 1.0**.
146
 
 
147
 
To see which version of the plugin a Drizzle server is running, execute:
148
 
 
149
 
.. code-block:: mysql
150
 
 
151
 
   SELECT MODULE_VERSION FROM DATA_DICTIONARY.MODULES WHERE MODULE_NAME='auth_schema'
152
 
 
153
 
Changelog
154
 
---------
155
 
 
156
 
v1.0
157
 
^^^^
158
 
* First release.