[cvs] [Wiki] created: HTTPAuthHowTo

Wiki Guest wikiguest at horde.org
Wed Nov 26 22:56:55 UTC 2008


guest [217.234.240.27]  Wed, 26 Nov 2008 17:56:55 -0500

Created page: http://wiki.horde.org/HTTPAuthHowTo

HTTP based authorization requests a user name and password from the  
user and compares them against a htpasswd file, in the form used by  
Apache and other web servers.

(detailed instructions pending)

Note: To make this work when PHP is run in CGI mode, you need to add  
the following rewrite rule to your htaccess file:

<code>
  RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</code>

Otherwise, the HTTP_AUTH_USER and HTTP_AUTH_PW fields will not be  
available to PHP. The above appears to be sufficient at least with PHP  
5.2, in earlier versions, you may need to add additional PHP code to  
extract the information from the HTTP_AUTHORIZATION into  
HTTP_AUTH_USER and HTTP_AUTH_PW, like this:

<code>
   $ha = base64_decode( substr($_SERVER['HTTP_AUTHORIZATION'],6) );
   list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) =  
explode(':', $ha);
</code>



More information about the cvs mailing list