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