Bug 80469 - Problem in PythonAuthenHandler
Problem in PythonAuthenHandler
Product: Red Hat Linux
Classification: Retired
Component: mod_python (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Gary Benson
Depends On:
  Show dependency treegraph
Reported: 2002-12-26 18:56 EST by Jim Thario
Modified: 2008-05-01 11:38 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2003-01-07 10:54:38 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jim Thario 2002-12-26 18:56:41 EST
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:

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

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
        return apache.HTTP_UNAUTHORIZED

def handler(req):
    return apache.OK
Comment 1 Gary Benson 2003-01-07 10:54:38 EST
This fails on 8.0 but works correctly on Rawhide.

Note You need to log in before you can comment on or make changes to this bug.