Welcome! Log In Create A New Profile

Advanced

Re: php auth & fast_cgi

March 14, 2011 09:22AM
The problem seemed to be that after the initial auth , the credentials
could not change (diff user/pass).

Thanx alot Francis for the fast reply and sorry for the crappy problem
description but that was the only input i had. My colleague (the web
dev) , seems to have found a solution to his problem.

Cheers

-
Alex

On 03/14/2011 01:39 PM, Francis Daly wrote:
> On Mon, Mar 14, 2011 at 12:58:35PM +0200, Alexander Economou wrote:
>
> Hi there,
>
>> A colleague of mine told me that these two lines in php doesn't seem to
>> work on an nginx + fastcgi installation. Any thoughts?
>
> They seem to work fine for me. Any expansion?
>
> What does your colleague do, what does your colleague see, and what
> does your colleague expect to see? And, if it's not obvious, what's the
> difference between the last two?
>
>> header('WWW-Authenticate: Basic realm="SocialWhale Controller"');
>>
>> $_SERVER['PHP_AUTH_USER']
>> $_SERVER['PHP_AUTH_PW'];
>
> authcheck:
> ===
> <?php
>
> if ($_SERVER['PHP_AUTH_USER'] == "x"&& $_SERVER['PHP_AUTH_PW'] == "x") {
> echo "Well done, right credentials\n";
> } else {
> header('WWW-Authenticate: Basic realm="SocialWhale Controller"');
> }
>
> ?>
> ===
>
> I expect "curl -i http://localhost/authcheck" to show me a HTTP 401,
> and "curl -i -u x:a http://localhost/authcheck" to show me a HTTP 401,
> and "curl -i -u x:x http://localhost/authcheck" to show me a HTTP 200.
>
> And that's what I see.
>
> nginx.conf ensures that the php fastcgi server processes the request,
> of course.
>
> All the best,
>
> f

--
---
Alexander Loukas Economou
Systems & Network
Administrator
gsm : 6986 298 859
email : aecon@sysadm.gr

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

php auth & fast_cgi

aecon March 14, 2011 07:02AM

Re: php auth & fast_cgi

Francis Daly March 14, 2011 07:42AM

Re: php auth & fast_cgi

aecon March 14, 2011 09:22AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 145
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready