Comments on: HTTP Authentication with PHP running as CGI http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/ Blog of a Programmer. Sun, 22 Jun 2008 09:21:13 +0000 http://wordpress.org/?v=2.5.1 By: Gary http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/#comment-24495 Gary Tue, 04 Mar 2008 13:33:32 +0000 http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/#comment-24495 Phew! You saved me lots of hassle :-) The only problem I had was that $_SERVER[’HTTP_AUTHORIZATION’] didn't exist, however $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] did (discovered with the aid of "print_r($_SERVER);"), so I did a swap and then the base64 decode worked a treat. Thank you! Phew! You saved me lots of hassle :-)

The only problem I had was that $_SERVER[’HTTP_AUTHORIZATION’] didn’t exist, however $_SERVER['REDIRECT_HTTP_AUTHORIZATION'] did (discovered with the aid of “print_r($_SERVER);”), so I did a swap and then the base64 decode worked a treat.

Thank you!

]]>
By: Asbjørn Ulsberg http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/#comment-24492 Asbjørn Ulsberg Mon, 03 Dec 2007 13:37:08 +0000 http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/#comment-24492 This didn't work for me. I've set up authentication in .htaccess and get the username/password challenge, but when I reach the little auth.php script I've created, it just says "Hello,You entered as your password:"; clearly the authentication information didn't drip through from Apache to PHP. Just echoing the $_SERVER['HTTP_AUTHORIZATION']; variable yields null too, so the .htaccess hack is clearly not working. Any idea why it isn't and what I can do to make it work? Do I need to turn on a magic switch for the [E] httpd directive to work, for instance? This didn’t work for me. I’ve set up authentication in .htaccess and get the username/password challenge, but when I reach the little auth.php script I’ve created, it just says “Hello,You entered as your password:”; clearly the authentication information didn’t drip through from Apache to PHP.

Just echoing the $_SERVER['HTTP_AUTHORIZATION']; variable yields null too, so the .htaccess hack is clearly not working. Any idea why it isn’t and what I can do to make it work? Do I need to turn on a magic switch for the [E] httpd directive to work, for instance?

]]>
By: Alex http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/#comment-24471 Alex Thu, 28 Jun 2007 06:34:57 +0000 http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/#comment-24471 You saved me from dispair. Amazing mod_rewrite trickery, well done. You saved me from dispair. Amazing mod_rewrite trickery, well done.

]]>
By: jan http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/#comment-6871 jan Mon, 29 Jan 2007 10:23:00 +0000 http://www.stevenroddis.com/2006/12/06/php-http-auth-cgi/#comment-6871 Thanks dude, it worked! Thanks dude, it worked!

]]>