[mod_python] How to get the Apache authentication requirements into Python script?

Scott Chapman scott_list at mischko.com
Mon Oct 6 12:11:27 EST 2003


I have a home-brew Apache Authentication module coming together using 
mod_python and I'm wondering how to get the 'require valid-user' and 'require 
group blah' info into my Python handler so I know which groups to look out 
for, etc.  I've been over the mod_python docs quite a bit and I can't find 
info on this.

<Location /members>
    SetHandler python-program
    PythonDebug On
    PythonAuthenHandler www
    AuthType Basic
    AuthName "Members Login"
    require group admin
</Location>

If I have the above in my httpd.conf file, I'd like to have the group 
requirement of 'admin' come through to the Python script and the Location.

If I have 'require valid-user' in a .conf or .htaccess file, I'd like to be 
able to get those in also.  I've got a hunch a .htaccess file is handled 
differently. Is that correct?

Scott


More information about the Mod_python mailing list