[mod_python] mod_python authentication

Bjorn Sundberg sundberg.bjorn at gmail.com
Tue Nov 22 18:34:49 EST 2005

Hello i'm still a newcomer to mod_python and i have some questions about
authentication in mod_python.I'm using the publisher with psp templates.

First of all, i'm trying to get the basic http authentication to work with
limited success. Some times the promt for the username and password shows
and some other times it does not. Second thong is that i have creat success
with the publisher handler authentication "__auth__(), __access__()". My
questions are, is the publisher handler authentication a basic http
authentication and whats the difference between the PythonAuthenHandler and
the publisher authentication?

Is there a way do use http digest authentication?

Thanks in advance.

Björn S

Here is my apache mod_python.conf file for basic http authentication.


<Directory /home/httpd/html/py/ip/ip2/5.1.1>
SetHandler mod_python
PythonHandler mod_python.publisher
PythonAuthenHandler 5-1-1
PythonDebug On
AuthType Basic
AuthName "Restricted Area"
require valid-user

-------python code-------------------

#!/usr/bin/env python
# -*- coding: ISO-8859-1 -*-

from mod_python import psp, apache

def authenhandler(req):

pw = req.get_basic_auth_pw()
user = req.user

if user == "spam" and pw == "eggs":
return apache.OK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mm_cfg_has_not_been_edited_to_set_host_domains/pipermail/mod_python/attachments/20051123/aa211dfe/attachment.html

More information about the Mod_python mailing list