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): How reproducible: Always 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. 4.Restart apache. 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. Additional info: The following information is taken from the mod_python user manual, section 3.4. Use this configuration in httpd.conf: <Directory /var/www/html/python> AddHandler python-program .py PythonHandler myscript PythonAuthenHandler myscript PythonDebug On AuthType Basic AuthName "Restricted Area" require valid-user </Directory> Use the following as myscript.py: from mod_python import apache def authenhandler(req): user = req.user pw = req.get_basic_auth_pw() if user == "spam" and pw == "eggs": return apache.OK else: return apache.HTTP_UNAUTHORIZED def handler(req): req.write("Hi") return apache.OK
This fails on 8.0 but works correctly on Rawhide.