You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found 2 issues in this module touching the BASIC AUTH.
Details about environment
Running this module on;
PHP 7.2
Apache
Readme
The example in the README does not work. In the original README there are double-quotes added.
But the double-quotes are not needed, the example below is the right way to add this environment variables;
For some reason Environment::getEnv('ENVCHECK_BASICAUTH_USERNAME') returns "test" and Environment::getEnv('ENVCHECK_BASICAUTH_USERNAME') will return "password".
$_SERVER['PHP_AUTH_PW'] and $_SERVER['PHP_AUTH_USER']
$_SERVER['PHP_AUTH_PW'] and $_SERVER['PHP_AUTH_USER'] checks in EnvironmentChecker.php -> init method are not working
For some reason, when I check on the variables above, I've keep getting the "basic auth form" and logging in.
Did some investigation, and the variables are just not available.
When I'm adding a $request = $this->getRequest(); and then use $request->getHeader('PHP_AUTH_USER') and $request->getHeader('PHP_AUTH_PW') the basic login works.
And now?
I'm willing to create a PR later, but right now I just don't have time to fix this and create a PR.
Because I've found this issue and I think its important to fix this, I've created a Issue to make sure this is documented somewhere.
Work-around;
For now, I've created a custom HealthCheck controller that doesn't involve the init method on the EnvironentChecker.
This way I can use my own basic authentication logic in my own controller.
The text was updated successfully, but these errors were encountered:
Now I'm not sure if we should replace the $_SERVER['PHP_AUTH_PW'] and $_SERVER['PHP_AUTH_PW'] variables.
But I found out that SilverStripe BasicAuth relies on $request->getHeader('PHP_AUTH_USER') and $request->getHeader('PHP_AUTH_PW') variables.
🤔 I can't make a choice.
Hi there,
I've found 2 issues in this module touching the BASIC AUTH.
Details about environment
Running this module on;
Readme
But the double-quotes are not needed, the example below is the right way to add this environment variables;
For some reason
Environment::getEnv('ENVCHECK_BASICAUTH_USERNAME')
returns"test"
andEnvironment::getEnv('ENVCHECK_BASICAUTH_USERNAME')
will return"password"
.In the README update PR I've created, there was a comment mentioning https://github.com/m1/Env#env-example. Quotes around
.env
variables should be allowed.Wierd issue, needs further investigation.
$_SERVER['PHP_AUTH_PW'] and $_SERVER['PHP_AUTH_USER']
$_SERVER['PHP_AUTH_PW']
and$_SERVER['PHP_AUTH_USER']
checks inEnvironmentChecker.php
->init
method are not workingFor some reason, when I check on the variables above, I've keep getting the "basic auth form" and logging in.
Did some investigation, and the variables are just not available.
When I'm adding a
$request = $this->getRequest();
and then use$request->getHeader('PHP_AUTH_USER')
and$request->getHeader('PHP_AUTH_PW')
the basic login works.And now?
I'm willing to create a PR later, but right now I just don't have time to fix this and create a PR.
Because I've found this issue and I think its important to fix this, I've created a Issue to make sure this is documented somewhere.
Work-around;
For now, I've created a custom HealthCheck controller that doesn't involve the
init
method on the EnvironentChecker.This way I can use my own basic authentication logic in my own controller.
The text was updated successfully, but these errors were encountered: