[mod_python] Chaining handlers

Graham Dumpleton graham.dumpleton at gmail.com
Mon Mar 24 00:00:36 EDT 2008

On 21/03/2008, David Champion <dgc at uchicago.edu> wrote:
> > The access, authentication and authorisation handler phases are:
>  >
>  >   http://www.modpython.org/live/current/doc-html/dir-handlers-ach.html
>  >   http://www.modpython.org/live/current/doc-html/dir-handlers-auh.html
>  >   http://www.modpython.org/live/current/doc-html/dir-handlers-auzh.html
>  >
>  > To get some context also see:
>  >
>  >   http://www.fmc-modeling.org/category/projects/apache/amp/4_4Request_Response_Loop.html
> I did read those sections of the mod_python manual.  I also just looked
>  at the response loop document, and all seem to agree that under various
>  circumstances (depending on which handler phase you're in) returning OK
>  or DECLINED should pass the request to the next handler.

More or less. One can also return an HTTP error status or DONE to
short circuit any request handling.

>  My code does this, but no matter which phase I've tried (access, auth,
>  headers, fixup, and more) the most I can get is my CGI served as a
>  static text/plain file.  Could it be a matter of priority?  It seems
>  that I'm able to position a C module first in the handler stack; maybe
>  that's why it works (see end).
>  > Although authentication phase handler is mainly used for HTTP Basic
>  > authentication, it can be adapted for use in form based login
>  > mechanism. It is a bit more tricky to do though.
> It doesn't seem any different from trying to accomplish authN in some
>  other phase, but I might be missing something.  Anyway I'm getting the
>  same results from all phases.

Without seeing your Apache configuration for setting up the handlers
and the code of the actual handlers, can't really say why you may be
having a problem.


More information about the Mod_python mailing list