RE: [Zope] Q: LoginManager and SQL-US?
Thanks to Dan Pierson and J.Atwood for pointing me at the GUF/SQL howto. I've beating my head against LM since. I even looked at the source code (which might be more useful if I spoke Python... Anyway, here's what I think I've figured out: Four methods must be created under a UserSource, whether DTML method, external, or whatever: userExists - passed 'username', return 1 if exists. userAuthenticate - passed 'username', 'password', return 1 if valid user. userRoles - passed 'username', return user roles in either space-delimited string, or list. userDomains - passed 'username', return either a list of valid domains (example?) or an empty list/string(?) to leave it wide open. How is that? Am I even getting close? It's worth noting that I still haven't been able to get LM working on either of two installs. At home I got past userExists and userAuthenticate, but then kept getting "Forbidden." It appears that I'm not successfully returning a list of roles back to the UserSource code. (When I uncomment the stuff to report that from ForbiddenPage, my roles are empty.) But is it possible that the real problem is the domains, or something else? At work, I can't seem to get past the login screen. I've tried dropping <dtml-raise ...> and python raise all over the damn place and it appears that program flow is going nowhere near those four methods or their wrappers in UserSource.py. The traceback shows: Traceback (innermost last): File /usr/local/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py, line 214, in publish_module File /usr/local/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py, line 179, in publish File /usr/local/Zope-2.1.6-src/lib/python/Zope/__init__.py, line 202, in zpublisher_exception_hook (Object: ElementWithAttributes) File /usr/local/Zope-2.1.6-src/lib/python/ZPublisher/Publish.py, line 151, in publish File /usr/local/Zope-2.1.6-src/lib/python/ZPublisher/BaseRequest.py, line 446, in traverse File /usr/local/Zope-2.1.6-src/lib/python/Products/LoginManager/LoginManager.py, line 149, in lm_unauth (Object: SheetProviderContainer) File /usr/local/Zope-2.1.6-src/lib/python/OFS/DTMLDocument.py, line 166, in __call__ (Object: loginForm) File /usr/local/Zope-2.1.6-src/lib/python/DocumentTemplate/DT_String.py, line 502, in __call__ (Object: loginForm) File /usr/local/Zope-2.1.6-src/lib/python/DocumentTemplate/DT_Raise.py, line 128, in render (Object: 'LoginRequired') LoginRequired: (see above) Clue anyone? TIA, Charlie
-----Original Message----- From: Dan L. Pierson [mailto:dan@sol.control.com]
Wilkinson Charlie E writes:
1. Can LoginManager be (easily?) made to meet my specific need?
Probably, it includes a GenericUserSource, which is essentially a clone of Generic User Folder (see below).
2. Has anyone done an SQL UserSource yet, or can anyone give me a clue how to make one?
You should look at Generic User Folder, and the HowTo that tell how to set it up with Postgressql. Basically, you need to create a number of SQLMethods to query your database and some wrappers for these methods. The SQLMethods are the only thing that has to care about the details of your database format.
participants (1)
-
Wilkinson Charlie E