On Wed, 17 May 2000, darren chamberlain wrote:

> 
> Hi, all.
> 
> I am trying to figure out a way to set a PerlAuthenHandler (using
> $r->push_handlers()) from a PerlInitHandler.

>     #$r->auth_type('Basic');

try $r->connection->auth_type('Basic');
i can't recall if that works quite right either.

>     #$r->auth_name('Test');

that should work.

>     #$r->requires([{requirement => 'valid-user',method_mask => -1}]);

this will not.  i think a better approach, assuming you want
authentication to be conditional, is to configure Auth{Name,Type} and
require valid-user in httpd.conf so the authentication phase is triggered.
if you decide you don't need to authenticate:
$r->push_handlers(PerlAuthenHandler => \&Apache::OK);

that is, you don't actually do any authentication, but apache is happy and
carries on since you return OK.  otherwise, push your real authentication
handler.

Reply via email to