[mod_python] Authentification with publisher handler

Wartan Hachaturow wart at softhome.net
Sat Apr 27 13:50:01 EST 2002


Hello.

I am trying to get an authentificated user's username from inside
a python code.

Here's the code:

__auth_realm__ = "Authorization"
__access__ = 1


def __auth__(req, user, passwd):
	if user == "foo" and passwd == "bar":
		return 1
	else:
		return 0

def stats(req):
	req.get_basic_auth_pw()
	return "<html><body>" + str(req.connection.user) + "</body></html>"	


What I get is a "None", i.e. req.connection.user is None. 
What could be the problem?

P.S. libapache-mod-python 2:2.7.6-1, python 2.1, apache 1.3.24

--
Regards, Wartan.

	



More information about the Mod_python mailing list