perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoffrey Young <>
Subject Re: [mp2] Perl Auth Handlers and mod_proxy : losing querystring on remote server (BUG?)
Date Wed, 10 Jan 2007 00:47:10 GMT

>  <LocationMatch /(?i)protected/>
>    AuthType Basic
>    AuthName "Test Authentication"
>    AuthUserFile /www/
>    require valid-user
>  </LocationMatch>

next test - keep all that the same but substitute

  PerlAuthenHandler My::Authen


 AuthUserFile /www/

and use this handler:

  package My::Authen;

  use Apache2::RequestRec ();
  use Apache2::Access ();

  use Apache2::Const -compile => qw(OK AUTH_REQUIRED);

  use strict;

  sub handler {

    my $r = shift;

    my ($status, $password) = $r->get_basic_auth_pw;

    return $status unless $status == Apache2::Const::OK;

    if ($r->user eq 'foo' && $password eq 'bar') {
      return Apache2::Const::OK;

    return Apache2::Const::AUTH_REQUIRED;


just using Apache2::Const::OK in your httpd.conf bypasses some
httpd-core API calls that authen might be expecting.  this setup
exercises everything pretty much the way the default file authen handler


View raw message