[mod_python] how to make fallback authentication

Tomasz Wlodek tomw at bnl.gov
Fri Feb 17 12:27:20 EST 2006

On Thu, 16 Feb 2006, Graham Dumpleton wrote:

> Unfortunately, to my mind, what would be the proper way of doing this
> can't current be done in mod_python because it has some stuff missing
> and doesn't process handlers for the authentication phase correctly. See:
>   http://issues.apache.org/jira/browse/MODPYTHON-124
>   http://issues.apache.org/jira/browse/MODPYTHON-129
> One question while I think of a good suggestion, how are you setting
> AuthType, AuthName and Requires directives to ensure that the mod_python
> authenhandler is being run in the first place?
> Graham

in mod python configuration I put:

<Directory /var/www/my_directory/cgi>
    AddHandler mod_python .py
    PythonHandler myhandler
    PythonAuthenHandler myhandler
    PythonDebug on
    PythonPath "sys.path + ['/root/my_mod_python_handlers']"
    require valid-user

This forces the authentication handler to run.

If I add

AuthType Basic
AuthName "Restricted Area"

lines, if always triggers apache to ask for user id and pwd, which is not
what I want. I want apache to ask for user id and pwd only if user has no
valid certificate.


More information about the Mod_python mailing list