Red Hat Bugzilla – Bug 80469
Problem in PythonAuthenHandler
Last modified: 2008-05-01 11:38:04 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.0.1) Gecko/20021003
Description of problem:
When using PythonAuthenHandler from mod_python to do programmatic
authentication, Apache expects an AuthUserFile to read users/passwords from,
which it shouldn't.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1.Create a /var/www/html/python directory
2.Add included snippet to httpd.conf
3.Put included myscript.py in /var/www/html/python directory.
5.Point browser at localhost:/python/myscript.py and enter "spam" as user and
"eggs" as password.
Actual Results: After getting prompted for the user and password, I get a
"Server error!" page and an entry in the /var/log/httpd/error_log:
"configuration error: couldn't check user. No user file?: /python"
Expected Results: After entering user and password, myscript.py should be
called to pass or fail the authentication.
The following information is taken from the mod_python user manual, section 3.4.
Use this configuration in httpd.conf:
AddHandler python-program .py
AuthName "Restricted Area"
Use the following as myscript.py:
from mod_python import apache
user = req.user
pw = req.get_basic_auth_pw()
if user == "spam" and pw == "eggs":
This fails on 8.0 but works correctly on Rawhide.