Basic authentication

From ULYSSIS documentation
Revision as of 20:27, 24 January 2017 by Bert (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Because in our webserversetup PHP is installed as a common gateway interface (CGI) basic authentication will not work in its usual way. There is however a workaround. First add a .htaccess file with following code in it:

<IfModule mod_rewrite.c> 
RewriteEngine on \n
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
</IfModule>


Next add the following line to your script right before the authentication:

list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':' , base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));

Now your script should work with basic authentication.