You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Bolt Thrower <ty...@winter.teiresias.net> on 2001/06/26 05:49:55 UTC

push_handlers and PerlAuthenHandler troubles

For a particular Location, I'd like to selectively (i.e., based on
arbitrary criteria) determine whether a visitor needs authentication.
So I set up a Location section in httpd.conf as follows:

<Location />
      AuthType Apache::AuthTicket
      AuthName HomeIntranet
      PerlAuthenHandler Intranet::CheckSiteAuthen
      #PerlAuthenHandler Apache::AuthTicket->authenticate
      PerlAuthzHandler Apache::AuthTicket->authorize
      require valid-user
</Location>

Intranet::CheckSiteAuthen looks like:

---[start]-----
package Intranet::CheckSiteAuthen;

use strict;
use DBI;
use Apache::Constants qw(:common);
use Intranet::common;
use Data::Dumper;


sub handler {
  my $r = shift;
  $r->warn("starting CheckSiteAuthen");
  $r->push_handlers(PerlAuthenHandler => 'Apache::AuthTicket->authenticate');

  return DECLINED;
}

1;
---[end]-----

But when I try to access a location under that configuration,
I see in my error log: 
[Mon Jun 25 18:33:55 2001] [crit] [client 192.168.10.15] configuration error:  couldn't check user.  No user file?: /u/IntranetLoginForm

(/u/IntranetLoginForm is the login CGI form that Apache::AuthTicket
uses).

All I'm trying to do at this point is set up a PerlAuthenHandler that
passes control to another one (Apache::AuthTicket->authenticate).

Of course, everything works with the configuration

<Location />
      AuthType Apache::AuthTicket
      AuthName HomeIntranet
      #PerlAuthenHandler Intranet::CheckSiteAuthen
      PerlAuthenHandler Apache::AuthTicket->authenticate
      PerlAuthzHandler Apache::AuthTicket->authorize
      require valid-user
</Location>

Any suggestions for me?

Thanks,
-- 
Steve Chadsey <ty...@teiresias.net>
"So drink to forget and drown all your sorrows
Bury your dreams and choose catharsis!"
    -- Sentenced, "Nepenthe"

RE: push_handlers and PerlAuthenHandler troubles

Posted by Christian Gilmore <cg...@tivoli.com>.
There are known bugs in push_handlers/set_handlers that I believe are
corrected in CVS and should be part of the 1.26 release. Perhaps these
bugs are the problem.

Regards,
Christian

> -----Original Message-----
> From: Bolt Thrower [mailto:tyr@winter.teiresias.net]
> Sent: Monday, June 25, 2001 10:50 PM
> To: modperl@apache.org
> Subject: push_handlers and PerlAuthenHandler troubles
>
>
> For a particular Location, I'd like to selectively (i.e., based on
> arbitrary criteria) determine whether a visitor needs authentication.
> So I set up a Location section in httpd.conf as follows:
>
> <Location />
>       AuthType Apache::AuthTicket
>       AuthName HomeIntranet
>       PerlAuthenHandler Intranet::CheckSiteAuthen
>       #PerlAuthenHandler Apache::AuthTicket->authenticate
>       PerlAuthzHandler Apache::AuthTicket->authorize
>       require valid-user
> </Location>
>
> Intranet::CheckSiteAuthen looks like:
>
> ---[start]-----
> package Intranet::CheckSiteAuthen;
>
> use strict;
> use DBI;
> use Apache::Constants qw(:common);
> use Intranet::common;
> use Data::Dumper;
>
>
> sub handler {
>   my $r = shift;
>   $r->warn("starting CheckSiteAuthen");
>   $r->push_handlers(PerlAuthenHandler =>
> 'Apache::AuthTicket->authenticate');
>
>   return DECLINED;
> }
>
> 1;
> ---[end]-----
>
> But when I try to access a location under that configuration,
> I see in my error log:
> [Mon Jun 25 18:33:55 2001] [crit] [client 192.168.10.15]
> configuration error:  couldn't check user.  No user file?:
> /u/IntranetLoginForm
>
> (/u/IntranetLoginForm is the login CGI form that Apache::AuthTicket
> uses).
>
> All I'm trying to do at this point is set up a PerlAuthenHandler that
> passes control to another one (Apache::AuthTicket->authenticate).
>
> Of course, everything works with the configuration
>
> <Location />
>       AuthType Apache::AuthTicket
>       AuthName HomeIntranet
>       #PerlAuthenHandler Intranet::CheckSiteAuthen
>       PerlAuthenHandler Apache::AuthTicket->authenticate
>       PerlAuthzHandler Apache::AuthTicket->authorize
>       require valid-user
> </Location>
>
> Any suggestions for me?
>
> Thanks,
> --
> Steve Chadsey <ty...@teiresias.net>
> "So drink to forget and drown all your sorrows
> Bury your dreams and choose catharsis!"
>     -- Sentenced, "Nepenthe"
>