-
Notifications
You must be signed in to change notification settings - Fork 27
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
Issues when using HTTP BASIC Auth on EnvironmentChecker.php #73
Comments
Update on README; Created the PR above to fix the readme. Update on Found this comment on http-auth on php.net suggesting a work around to use this variable; Now I'm not sure if we should replace the But I found out that SilverStripe BasicAuth relies on |
I've tested this locally using a CMS 5.3 install and there no longer appears to be any issue with either of these. The env variable quoting works correctly with and without double quotes, and the basic auth works as I'd expect it to when accessing |
The second issue
is still a problem for me on a CMS 5.3 install (after working around the open #92 problem) |
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: