When running under CGI mode, PHP does not have access to the basic authentication headers. FuelPHP first checks \Input::server('PHP_AUTH_USER') and if that is unavailable falls back to getting the headers via \Input::server('HTTP_AUTHENTICATION'). However, \Input::server('HTTP_AUTHENTICATION') does not contain the necessary data by default. Add the following lines to your .htaccess file to pass through the headers to PHP:
Apologies. This is actually when running as FCGId, NOT as a CGI wrapper as I incorrectly specified in the original post. I forgot we changed over. My working configuration uses:
It does not want to work if the new auth rewrites are placed anywhere after the following lines, despite these conditions being met (the url is indeed being rewritten after those conditions as the file nor directory exists and is being routed by Fuel):
# Send request via index.php if not a real file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
The following DOES work for me though:
...
# make HTTP Basic Authentication work on php5-fcgi installs