[mod_python] getting username when using publisher auth

Hugo van der Merwe s13361562 at bach.sun.ac.za
Sat May 11 17:44:27 EST 2002

Is it possible to get at the username from "normal code" when
authentication is done using __auth__ methods? req.connection.user is

def test(req):
    def __auth__(req, user, passwd):
        if user == "eggs" and passwd == "spam":
            return 1
            return 0

    return "Hello "+str(req.connection.user)

returns "Hello None"... adding a call to req.get_basic_auth_pw() does 
not help.

Hugo van der Merwe

More information about the Mod_python mailing list