you definitely do want to pass the coderef to push_handlers...

ok, maybe I get what's going on...

PerlAuthenHandler will only be called if AuthName, AuthType, and require
directives are set in httpd.conf (or at least, so I gather from the docs).

also from the docs, all three of those directives seem to be read-only.  So,
and I'm only guessing here, it would seem that you can't force
PerlAuthenHandlers to run if the directory (or file) isn't already set up
for authentication.

running a few quick tests, the Authen phase isn't even entered, even when
push_handlers() is used...

maybe you'd be better off pushing an Access handler?  Or setting up
everything for Authen?

HTH

--Geoff

> -----Original Message-----
> From: darren chamberlain [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, May 17, 2000 11:48 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Setting authentication via a PerlInitHandler?
> 
> 
> > 
> > I am trying to figure out a way to set a PerlAuthenHandler (using
> > $r->push_handlers()) from a PerlInitHandler.
> 
> Follo-wup with more info.
> 
> here is my auth sub:
> 
> sub auth {
>     my $r = shift;
> 
>     print STDERR Data::Dumper->Dump( [$r], ['Apache']);
>     print STDERR "in auth handler\n"
>     return OK;
> }
> 
> Adding this to the handler sub:
> 
>     print STDERR "Before pushing:";
>     $do->get_handlers;
>     $r->push_handlers(PerlAuthenHandler => \&bgep_auth );
>     print STDERR "After pushing:";
>     $do->get_handlers;
> 
> give me this in the error_log:
> 
> Before pushing:
> Debug get_handlers for [127.0.0.7] /test/ during PerlInitHandler
> After pushing:
> Debug get_handlers for [127.0.0.7] /test/ during PerlInitHandler
>     CODE(0x831a06c) => enabled as PerlAuthenHandler
> 
> Apparently, pushing a code ref onto the handler stack, which 
> is what the docs
> say to do, isn't what I want. Changing the relevent section 
> in handler to:
> 
>     print STDERR "Before pushing:";
>     $do->get_handlers;
>     $r->push_handlers(PerlAuthenHandler => &bgep_auth );
>     print STDERR "After pushing:";
>     $do->get_handlers;
> 
> Gives me:
> 
> Before pushing:
> Debug get_handlers for [127.0.0.7] /test/ during PerlInitHandler
> $Apache = undef;
> in auth handler
> After pushing:
> Debug get_handlers for [127.0.0.7] /test/ during PerlInitHandler
> 
> (It runs the sub in place, and $r is not defined)
> 
> darren
> 
> -- 
> There is no hell. There is only France.
> 

Reply via email to