Hello all,

I need to implement a SSO solution for Moodle and Zope. My use case is:

1. The user logs in Zope.
2. Zope logs in Moodle (in behalf of the user) and forwards the authentication cookie to the client.

I suppose that the user has the same credentials in Zope and Moodle.

I'm trying to implement a script like the one shown below but it seems too tricky and it does not work. Has anybody implemented this kind of sso with zope and moodle or whatever?

Thank you very much!

My script now looks like this:

URL_AUTH = 'http://localhost/moodle/login/index.php'
params = {'username':'foo', 'password':'bar'}
conn = urllib2.urlopen(URL_AUTH, urlencode(params)) mycookie = conn.info().getheaders('Set-Cookie')[-1] # Get the cookie MOODLEID_
name = mycookie[0: int(mycookie.find("="))]              # Get the name
value = mycookie[mycookie.find("=")+1: mycookie.find(";")]   # The value
self.REQUEST.RESPONSE.setCookie(name, value, path='/moodle', domain='localhost')
self.REQUEST.RESPONSE.redirect("http://localhost/moodle";)

_______________________________________________
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to