Bug 80469

Summary: Problem in PythonAuthenHandler
Product: [Retired] Red Hat Linux Reporter: Jim Thario <jim>
Component: mod_pythonAssignee: Gary Benson <gbenson>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2003-01-07 15:54:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jim Thario 2002-12-26 23:56:41 UTC
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

Comment 1 Gary Benson 2003-01-07 15:54:38 UTC
This fails on 8.0 but works correctly on Rawhide.