You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Hann, Brian" <Br...@umb.com> on 2003/03/19 21:12:55 UTC
notes() and mod_perl ErrorDocuments
I have a mod_perl handler set as the 401 ErrorDocument for a certain
location that requires authentication. I would like to store data in
notes() in the first location so that the 401 handler can access them.
Is that possible? So far I haven't been able to get it to work. If it
is not, is there some way I could internally mimic Apache's
authentication challenge/response setup? For instance, what happens
when you return AUTH_REQUIRED to Apache? Is it possible to do this
inside a mod_perl handler by using set_handlers()?
Thanks,
Brian Hann
Re: notes() and mod_perl ErrorDocuments
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
Hann, Brian wrote:
> I have a mod_perl handler set as the 401 ErrorDocument for a certain
> location that requires authentication. I would like to store data in
> notes() in the first location so that the 401 handler can access them.
> Is that possible? So far I haven't been able to get it to work.
try $r->prev->notes
> If it
> is not, is there some way I could internally mimic Apache's
> authentication challenge/response setup? For instance, what happens
> when you return AUTH_REQUIRED to Apache?
this is all explained in chapter 13 in the cookbook, as well as in the eagle
book. for an example of plugging into authentication, see
http://www.modperlcookbook.org/code/ch13/Cookbook/Authenticate.pm
> Is it possible to do this
> inside a mod_perl handler by using set_handlers()?
well, not really. unfortunately, you can't just set or push authentication,
since Apache skips it unless you have a Require directive attached to the
ErrorDocument.
HTH
--Geoff