[mod_python] Apache 2.2 authen/authz and "require" semantics

Arnar Birgisson arnarbi at gmail.com
Mon Sep 24 08:17:08 EDT 2007


On 9/24/07, Graham Dumpleton <graham.dumpleton at gmail.com> wrote:
> > My main problem remains that depending on the project (identified by
> > the first part of the url), I might want to skip authentication and
> > authorization all together since some projects allow anonymous access.
> > I don't know how to make that decision, whether to request a login
> > from the user, in python code.
>
> Have an authenhandler which identifies the URL you need to let through
> and simply do:
>
>   req.user = 'anonymous'
>   return apache.OK
>
> Setting req.user should be sufficient to prevent complaints from
> Apache and would satisfy 'Require valid-user' check.

Seems to work for svn at least :)

Thank you,
Arnar


More information about the Mod_python mailing list