Using a NATs dB for Elevated X Protect connections Print

  • 0

You can use your NATs dB to authorize and login members using ELevated X Protect.
This document covers the setup/configuration of the config.php file.

1) Within authmethods, change:

authmethods="htpasswd_1"

to:

authmethods="mysql_1"

What this does is take out the standard .htpasswd file scheme that's commonly used and use NATS instead.

2) Next, under [mysql_1], set it up like so:

[mysql_1]
label="MySQL Connection"
method="mysql"
db_host="[DATABASE_HOSTNAME]"
db_user="[DATABASE_USER]"
db_pass="[DATABASE_PASSWORD]"
database="[DATABASE_NAME]"
table="member_auth"
username_column="username"
password_column="password"
salt=""
hash=""
where="siteid=4"

You can see how I set this up within the actual config file.

Here's where I got each of these fields:

db_host, db_user, db_pass, database:
These are the credentials for NATs dB
It looks like on newer copies of mod_auth_mysql, we'll need to get this information from the user, since it's no longer stored in .htaccess, but instead the server's httpd.conf file (which we don't always have access to, offhand).

table: The value from Auth_MySQL_Password_Table.
In the case of NATS, this is almost always member_auth.

username_column: The value from Auth_MySQL_Username_Field.
In the case of NATS, this value is always username

password_column: The value from Auth_MySQL_Password_Field.
In the case of NATS, this value is always password.

salt: If a database uses some kind of Salt column, put in that column.
In the case of NATS, leave this blank.

hash: If a database hashes the passwords of the users, put in the hash type that's used here.
In the case of NATS, leave this blank.

where: If you're trying to limit which users can log in based on some other sort of SQL criteria, put this in here.
Example: if you see something like this in the .htaccess file:

Auth_MySQL_Password_Clause " AND siteid=4"

You will want to set:

where="siteid=4"

In this case, you leave the "AND" part out.

Otherwise, if you don't see anything like this, you'll want to leave this blank.


Was this answer helpful?

« Back