NATS4 MySQL Auth

From TMM Wiki
Revision as of 11:14, 22 September 2008 by Tmmdan (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
NATS 4
Members Admin
The Members Admin
View Member Details
Add Member
MySQL Auth
Mod Authn DB
Multisite Access
Member Logging
Member Password Retrieval
OpenID Connect
Mod Auth OpenIDC
ID Numbers

Setting up MySQL Auth

This article applies to mod_auth_mysql 3.0

Biller Member Management

Tell the biller to turn off user management on their end.

.htaccess

For NATS password management you'll have to use a mysql auth method, like Apache's mod_auth_mysql. Below are specific config settings for mod_auth_mysql:

AuthName "Members Only"
AuthType Basic
AuthGroupFile /dev/null
AuthMySQLHost localhost
AuthMySQLDB <name of the nats datatbase>
AuthMySQLUser <user for the nats database>
AuthMySQLPassword <password for the user for the nats database>
AuthMySQLUserTable member
AuthMySQLNameField username
AuthMySQLPasswordField password
AuthMySQLPwEncryption none
AuthMySQLUserCondition "status=1 AND siteid=X"
require valid-user

Replace X in "siteid=X" to the ID number of one of your sites. To use a single member's area for all of your sites, remove "AND siteid=X" from the line. See the Multisite Access article for more options.

To use your old password files in combination with mod_auth_mysql, add the following line to the config on top of the auth mod_auth_mysql lines:

AuthMySQLAuthoritative Off

Notes

If other sites on the server use htaccess for authentication, but aren't using mod_auth_mysql, add the followiong options to the top of their htaccess files:

AuthMySQLEnable Off
AuthMySQLAuthoritative Off

Alternate Server Member Management

If your NATS database is not on the same server as your member's area, use the following instructions.

Use the GRANT command to grant the appropriate permissions to the NATS database username at the IP address of each member's area server and change the value of the AuthMySQLHost directive to the IP address of the NATS server. If you don't know how to do this, please request your Host or Server admin to allow the NATS database user to access the database from your members area servers.


Database Copy Errors

The following error, which sometimes occur when you copy your NATS database from one server to another, means you didn't escape the MySQL reserved word, cascade:

ERROR 1064 at line 678: You have an error in your SQL syntax. Check
the manual that corresponds to your MySQL server version for the right
syntax to use near 'cascade char(16) NOT NULL default '', siteid int(10) unsigned

Escape the word cascade with a high comma (`) in the SQL query. Note: the high comma is also called a back-tic, and on US keyboards, it is usually left of the number 1 key.

See Also