I have a PHP application behind apache. Apache was using NTML authentication and serving the page from the local host.
I've changed things around, and moved the authentication to an external apache server using SAML2.
The new apache system is also functioning as a reverse proxy for the application.
Once I got all the auth pieces working, but my app complains there is no user being passed.
Interesting. So, I whip up this simple page:
<?php
phpinfo();
foreach (getallheaders() as $name => $value) {
echo "$name: $value\n";
}
print "User name: \"".$_SERVER["REMOTE_USER"]."\"";
?>
phpinfo() and the foreach both reveal that HTTP_USER is being set.
However, the explicit call for REMOTE_USER comes up blank!
The application is open source, so I can see they are calling $_SERVER["REMOTE_USER"].
I have another application that is closed source, but exhibits the same symptoms. It shows me the variables, but the authorization mechanism cannot seem to process the user.
This very well may not be a PHP issue at all, but since I can reproduce it within PHP, I figured I would start here to dig deeper into how this works, and where the fault may be.
Thanks!