Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work on Apache 2.2 - Fix included #26

Open
Navi2016 opened this issue Jul 7, 2021 · 0 comments
Open

Does not work on Apache 2.2 - Fix included #26

Navi2016 opened this issue Jul 7, 2021 · 0 comments

Comments

@Navi2016
Copy link

Navi2016 commented Jul 7, 2021

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 Navi2016 changed the title Does not work on Apache 2.2 Does not work on Apache 2.2 - Fix included Jul 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant