Hi All,

I'm a newbie and have an issue setting up Apache authn_dbd mysql authentication to work with Drupal 7 db.

Passwords stored in db start with substr $S$ and from here I can see that they are sha512 crypted passwords:
https://api.drupal.org/api/drupal/includes%21password.inc/function/user_...

and the plain text password is crypted via the following command
$hash = _password_crypt('sha512', $password, $stored_hash);
where
$stored_hash = substr($account->pass, 1);

Through my googling I realized that Apache class Crypt is capable of MD5 and sha512 cryptography.
https://httpd.apache.org/docs/2.4/misc/password_encryptions.html
https://httpd.apache.org/docs/current/programs/htpasswd.html

I can't seem to find a working command.
AuthDBDUserPWQuery "SELECT Crypt.crypt(password, "$S$") FROM authn WHERE user = %s"

I'm just wondering if it is possible to use crypt function via htpasswd in Apache site.conf to hash the plain text password.

Thanks