Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

note_basic_auth_failed failed

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


ecrombez at lanthrasites

Nov 2, 2009, 2:37 AM

Post #1 of 3 (108 views)
Permalink
note_basic_auth_failed failed

Hello, I try to use PerlAuthzHandler but the return HTTP_UNAUTHORIZED
doesn't work.

My Apache2 (2.0.8) config work fine without Handler

Alias /davb /var/www/www.mydomain.com/dav/

<Location /davb/>
AuthType Basic
AuthName WebDavBasic
require valid-user
PerlAuthzHandler Lantra::WebDavAuthz
</Location>

So, my Location work fine, the web browser ask login/passwd, analyse it
and serve the ressource.
But I want authorize only some ressources, I had the PerlAuthzHandler
for this, but the return Apache2::Const::HTTP_UNAUTHORIZED does'nt work.

My handler is :

use Apache2::Access ();

package Lantra::WebDavAuthz;

sub handler {
my $r = shift;
my $user = $r->user;

$r->server->log_error("Lantra::WebDavAuthz ! analyse USER=$user");

$r->note_basic_auth_failure;
return Apache2::Const::HTTP_UNAUTHORIZED;
}
1;

My Handler is called, /var/log/apache/error.log say "Lantra::WebDavAuthz
! analyse USER=manu", so the handler is called.

WHY RETURN HTTP_UNAUTHORIZED DOESN'T WORK ?

I use mod_perl 2.0.3 on a debian Lenny/sid Linux


aw at ice-sa

Nov 2, 2009, 5:02 AM

Post #2 of 3 (100 views)
Permalink
Re: note_basic_auth_failed failed [In reply to]

CROMBEZ Emmanuel wrote:
> Hello, I try to use PerlAuthzHandler but the return HTTP_UNAUTHORIZED
> doesn't work.
>
What do you mean by "it doesn't work" ?
Can you give us a clue ?


ecrombez at lanthrasites

Nov 2, 2009, 8:08 AM

Post #3 of 3 (98 views)
Permalink
Re: note_basic_auth_failed failed [In reply to]

André Warnier a écrit :
> CROMBEZ Emmanuel wrote:
>> Hello, I try to use PerlAuthzHandler but the return HTTP_UNAUTHORIZED
>> doesn't work.
>>
> What do you mean by "it doesn't work" ?
> Can you give us a clue ?
>
>
In the documentation I read :

$r->note_basic_auth_failed;
return Apache2::Const::HTTP_UNAUTHORIZED;

This code (in PerlAuthenHandler and PerlAuthzHandler) must return an 401
HTTP error code, but I have a 200 !
First, I thought "the handler is not called", I added some log, and the
handler is called.

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.