php-apache2-basic-auth-manager icon indicating copy to clipboard operation
php-apache2-basic-auth-manager copied to clipboard

Does not work on Apache 2.2 - Fix included

Open Navi2016 opened this issue 3 years ago • 0 comments

Because of the bcrypt password encryption algoritm. It's default in PHP but Apache 2.2 does not support it.

https://httpd.apache.org/docs/2.2/misc/password_encryptions.html

Apache 2.4 does support it.

If you want this to work for Apache 2.2 Change \vendor\rafaelgou\php-apache2-basic-auth\src\Apache2BasicAuth\Model\User.php:83

from:

$this->setHash(password_hash($password, PASSWORD_BCRYPT));

to:

$this->setHash(crypt($password, '$1$'.bin2hex(random_bytes(4)).'$'));

It will now use the less secure MD5 algo, but at least it works.

Navi2016 avatar Jul 07 '21 11:07 Navi2016