Rodney Hampton wrote:
> Does anyone have an example of how to use $r->requires?
see recipe 13.6 in the cookbook, the code for which can be found here:
http://www.modperlcookbook.org/code/ch13/Cookbook/AuthzRole.pm
> I cannot find Apache::AuthzAge for an example of its use.
> I'm trying to handle all my location directive specific stuff in a
> TransHandler and simply want to
> set require valid-user for some specific paths.
$r->requires() is read-only. conditional authentication is a bit
counterintuitive - you can't set up authentication where it doesn't
already exist because Apache won't run the authentication phase
without a Require directive in your httpd.conf. the solution is to
turn on authentication for everything, then turn it off where you
don't need/want it. see recipe 13.5 in the cookbook for more details.
the code for 13.5 can be found here:
http://www.modperlcookbook.org/code/ch13/Cookbook/PassLocalIP.pm
see also the Satisfy directive
http://httpd.apache.org/docs/mod/core.html#satisfy
if you're only looking to do conditional authentication based on IP
addresses/hostnames.
HTH
--Geoff