Current time: 11-26-2024, 01:40 AM Hello There, Guest! (LoginRegister)


Post Reply 
Basic HTTP Auth Fails
Author Message
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #11
RE: Basic HTTP Auth Fails
Hi all

I searched the net and it seems that its possible to get a functional Basi HTTP Auth together with Fastcgi (I could not test with fcgi!).

Change the /etc/apache2/mods_enabled/fastcgi_ispcp.conf, the FastCgiConfig Parameters (the "-pass-header" especially):
Code:
FastCgiConfig -minProcesses 1 \
                      -maxProcesses 400 \
                      -maxClassProcesses 5 \
                      -multiThreshold 80 \
                      -killInterval 60 \
                      -startDelay 5 \
                      -idle-timeout 300 \
                      -pass-header Authorization
it seems you just can replace:
-pass-header HTTP_AUTHORIZATION
with:
-pass-header Authorization

in PHP - you have to add this before using the $_SERVER['PHP_AUTH_*'] Variables:
Code:
if (isset($_SERVER['Authorization']) && !empty($_SERVER['Authorization'])) {
    list ($type, $cred) = split (" ", $_SERVER['Authorization']);

    if ($type == 'Basic') {
        list ($user, $pass) = explode (":", base64_decode($cred));
        $_SERVER['PHP_AUTH_USER'] = $user;
        $_SERVER['PHP_AUTH_PW'] = $pass;
    }
}

This works for me - the installation is an very old upgraded RC7 but should work also for other fastcgi installations...

Cheers Joxi
(This post was last modified: 04-02-2009 09:55 PM by joximu.)
04-02-2009 09:54 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Messages In This Thread
Basic HTTP Auth Fails - satlizard26 - 03-22-2009, 03:39 PM
RE: Basic HTTP Auth Fails - BeNe - 03-23-2009, 06:23 AM
RE: Basic HTTP Auth Fails - rbtux - 03-23-2009, 06:31 AM
RE: Basic HTTP Auth Fails - satlizard26 - 03-24-2009, 03:26 AM
RE: Basic HTTP Auth Fails - rbtux - 03-24-2009, 03:30 AM
RE: Basic HTTP Auth Fails - satlizard26 - 03-25-2009, 03:24 AM
RE: Basic HTTP Auth Fails - rbtux - 03-25-2009, 04:08 AM
RE: Basic HTTP Auth Fails - kilburn - 03-25-2009, 10:11 PM
RE: Basic HTTP Auth Fails - satlizard26 - 03-26-2009, 04:39 PM
RE: Basic HTTP Auth Fails - kilburn - 03-26-2009, 11:50 PM
RE: Basic HTTP Auth Fails - joximu - 04-02-2009 09:54 PM
RE: Basic HTTP Auth Fails - pongraczi - 06-25-2009, 07:01 AM
RE: Basic HTTP Auth Fails - joximu - 06-25-2009, 08:17 AM
RE: Basic HTTP Auth Fails - pongraczi - 06-25-2009, 08:29 PM
RE: Basic HTTP Auth Fails - kilburn - 06-25-2009, 11:25 PM

Forum Jump:


User(s) browsing this thread: 1 Guest(s)