Sorry it took me so long. I looked into this and it cannot be done this way easily as I though. The reason is that OID uses the two tables you created (and you are correct) and does not use auth_user at all. Hence it cannot take advantage of the functionality of Auth (access control, etc etc.). Open id can only determine if a user is logged in or not.
The best one can do is create a new OpenIDAuth class that replaces Auth and exposes similar 'login', 'logout', 'require login' functionality. I think you did this already in the OpenID app. Massimo On Jul 29, 5:12 pm, hcvst <[email protected]> wrote: > Hi, > > I am just trying to implement CasAuth to plug openID (oID) into auth > (). > I've got a simple oID server/consumer app using the Janrain > Python oID lib. > > The login_methods.gae example included in the login_methods folder > seems to fit (too) well, as all external calls are wrapped nicely in > the > gae lib, but I am struggling to see how to do the same with my oID. > > Here's what I've tried now. It works.. just. > > 1 - Pack all oID functionality into a module and place it in > myapp/modules > .../modules/w2popenid.py (http://pastebin.co.za/23469) > > 2 - the module provides an oID service a bit like Auth such > that it can be served via a single controller function. > > consumer_service = w2popenid.Consumer(env, db) > def oid_consumer(): return (form=consumer_service()) > > 3 - in db.py, I set auth.settings.login_form (or so) to > > from app.modules.w2popenid import OpenIDAuth > auth.settings.login_form = OpenIDAuth(service_url, globals()) > > where > OpenIDAuth implements/extends the class CasAuth > and service_url : URL(...f='oid_consumer') > is the url of the controller function bound to consumer_ service > in 2. above so that CasAuth.login_url can provide the service URL, > when asked by auth. > > Then it's a back and forth between controller, openID provider > and OpenIDAuth, with all required data stored somewhere in session. > > Is that how one should plug sth like oid into auth()? > > If that is the correct approch, there are some other issues: > For example if oid_consumer() is defined outside the default > controller, > auth() seems to get mixed up and redirects to the default controller. > Also, I don't seem to be able to flash my status codes back via > session.flash > Finally I am not sure whether I have to extend the users table to > cater for > additional openID fields and how best to do this. > But these are issues to solve once I know I didn't misunderstand > login_methods.. > > If this doesn't make much sense. Please get me to the point tomorrow. > Time to say... > > Good night, > HC --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/web2py?hl=en -~----------~----~----~----~------~----~------~--~---

