0

Has anybody managed to use a Wordpress wp_users table as input for apache's mod_authn_dbd ? This used to work for the apache 2.2 mod_auth_mysql, which had

Auth_MySQL_Encryption_Types PHPass PHP_MD5

but after a lot of searching, I still fail to understand how I can possibly make mod_authn_dbd to match the "$P$B / md5" passwords it gets from the wp_users table.

Here's the base config I'm starting with:

DBDriver mysql
DBDParams "dbname=wp_test host=127.0.0.1 port=3306 user=root pass=rootpass"
DBDMin  2
DBDKeep 4
DBDMax  10
DBDExptime 300

Alias /test /home/test/test
<Directory "/home/test/test">
    Options +Indexes
    AuthType Basic
    AuthName "Authentication required"
    AuthBasicProvider dbd
    AuthDBDUserPWQuery "SELECT user_pass as password FROM wp_users WHERE user_login = %s"
    Require valid-user
</Directory>

The error I'm getting is

[auth_basic:error] [pid 14812] [client 192.168.0.2:57126] AH01617: user test: authentication failure for "/test/": Password Mismatch

So it's obvious that apache uses a different hash format as wordpress - but is there any way to match these 2 up for the required comparison?

1 Answers1

1

Actually, the solution is to install a WP plugin like PHP native password hash - that changes the passwords to bcrypt which is in turn recognized by apache.