UserName automated authentication

Steve Purcell stephen_purcell at yahoo.com
Sat Feb 17 06:31:50 EST 2001


Mike Bunyan wrote:
> I am experimenting with Zope to provide an intranet for 100 or so
> people.
> [snip]
> The idea is to use a python script (or sniffer) to get UserName and
> authenticate this against a permissions table in mysql or gadfly. The
> user does not have to complete any login and cookies would persist for
> session.
> 
> I am puzzled by the behaviour of each of the following calls:
> A = os.system('echo %username%')
> B = win32api.GetUserName()
> C = os.environ['USERNAME']

You can't use this kind of code from within Zope, because anything executed
there is effectively being executed by the user who started the Zope server
('system' -- the NT service manager?), not the user browsing the server.

You'll have to get users to enter their username and password, as with any
other web service.

For that, I'm sure there are a wealth of authentication/user database products
available for Zope.

Best wishes,

-Steve

-- 
Steve Purcell, Pythangelist
Get testing at http://pyunit.sourceforge.net/
Get servlets at http://pyserv.sourceforge.net/
"Even snakes are afraid of snakes." -- Steven Wright




More information about the Python-list mailing list