Current time: 11-16-2024, 07:54 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
pongraczi Offline
Junior Member
*

Posts: 80
Joined: Jul 2008
Reputation: 2
Post: #12
RE: Basic HTTP Auth Fails
(04-02-2009 09:54 PM)joximu Wrote:  This works for me - the installation is an very old upgraded RC7 but should work also for other fastcgi installations...

Cheers Joxi

Hi Joxi,

Are there any similar solution for fcgid? I use fcgid and I have an issue to get working the webdav interface of egroupware 1.6.x.

I got a neverending basic authentication popup and it seems, it cannot make a session. Anyway, except this, egroupware is working well on ispcp.

Thanks,
István
06-25-2009 07:01 AM
Visit this user's website Find all posts by this user Quote this message in a reply
joximu Offline
helper
*****
Moderators

Posts: 7,024
Joined: Jan 2007
Reputation: 92
Post: #13
RE: Basic HTTP Auth Fails
sorry - I use fastcgi and therefore cannot test this.
did you goolge for "pass-header authorization fcgid"?

/J
06-25-2009 08:17 AM
Visit this user's website Find all posts by this user Quote this message in a reply
pongraczi Offline
Junior Member
*

Posts: 80
Joined: Jul 2008
Reputation: 2
Post: #14
RE: Basic HTTP Auth Fails
I googled around a little bit, but no breakthrough yet.
06-25-2009 08:29 PM
Visit this user's website Find all posts by this user Quote this message in a reply
kilburn Offline
Development Team
*****
Dev Team

Posts: 2,182
Joined: Feb 2007
Reputation: 34
Post: #15
RE: Basic HTTP Auth Fails
To enable authorization under fcgid, you only have to edit it's configuration file /etc/apache2/mods-enabled/fcgid_ispcp.conf, adding a line like this:
Code:
PassHeader AUTHORIZATION

After that, you can use the following snippet to populate $_SERVER variables with the user supplied values, and work from here Smile
PHP Code:
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':' base64_decode(substr($_SERVER['AUTHORIZATION'], 6))); 

Cheers!
(This post was last modified: 04-08-2010 05:41 AM by kilburn.)
06-25-2009 11:25 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply 


Forum Jump:


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