Hi all,
I'm putting together a mp2 application where I'd like to trigger authentication
from within a PerlTransHandler, and not from httpd.conf.
As I understand it, the following should work:
-----
use Apache2::RequestUtil ();
$r->add_config(['require valid-user']);
$r->push_handlers(PerlAuthenHandler => 'My::App::Authen');
$r->push_handlers(PerlAuthzHandler => 'My::App::Authz');
-----
But the authen handler doesn't get called. If I add the require line to httpd
conf, it does.
I've tried including AuthName and AuthType in the call to add_config, moving
this to a PerlPostReadRequestHandler, setting PerlOptions +GlobalRequest and
other tricks, to no avail.
$r->get_handlers('PerlAuthenHandler') confirms that the handler is set, and
$r->requires (using Apache2::Access) indicates that the valid-user requirement
has actually been set.
I'm running mod_perl 2.0.4, perl 5.12.3 and Apache 2.2.17 on Fedora 14.
What am I missing? Is there something else that could prevent this from
working, when it works just fine if I set requires in httpd.conf?
Any pointers would be very much appreciated!
Thanks,
Andrew.