Hi List, I have an application where I need to have a large number of users. I don't want to override Zope's existing user authentication mechanism, but I am trying to wrap it in my own code, to access additional information about a user. Here's what I want to do: Present user with login form. Pass username and password to Zope to authenticate. If authenticated, retrieve additional information related to that user. One part of this is I would like a user to become an authenticated user as far as zope is concerned once they have logged in via my form. This is the part I am having trouble with. Right now, I simply pass authentication credentials to my acl_users.authenticate method, passing None as the 'request' argument. This seems to return either "None" or a user name, at least as far as the print command is concerned. I don't know a tremendous amount about how user authentication works in Zope, but my assumption is that when you login, say by going to /manage, it returns a cookie of some sort that marks you as authenticated and contains an id to identify who you are authenticated as. How would I provide this functionality in a script of my own making? Thanks for any help. Alec Munro
I don't know a tremendous amount about how user authentication works in Zope, but my assumption is that when you login, say by going to /manage, it returns a cookie of some sort that marks you as authenticated and contains an id to identify who you are authenticated as. How would I provide this functionality in a script of my own making?
The standard Zope user folder uses HTTP Basic Authentication and no cookies. You cannot "wrap" this in a script as you propose, it is not possible. You should select a different user folder (see zope.org) that uses cookies or use a user folder in conjunction with the CookieCrumbler product to add the cookie functionality. Then you can have regular login pages. Some of the user folders allow you to have additional data on the user as well. jens
Alec Munro wrote at 2004-8-13 20:31 -0300:
I have an application where I need to have a large number of users. I don't want to override Zope's existing user authentication mechanism, but I am trying to wrap it in my own code, to access additional information about a user.
Maybe, you look for "exUserFolder". It can do this out of the box... -- Dieter
Alec Munro wrote:
I have an application where I need to have a large number of users. I don't want to override Zope's existing user authentication mechanism, but I am trying to wrap it in my own code, to access additional information about a user. Here's what I want to do: Present user with login form. Pass username and password to Zope to authenticate. If authenticated, retrieve additional information related to that user.
Look for the PluggableAuthService or SimpleUserFolder, both may help you... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (4)
-
Alec Munro -
Chris Withers -
Dieter Maurer -
Jens Vagelpohl