[Zope] Moodle and Zope SSO.

Jose Luis de la Rosa Triviño joseluis.rosa at iavante.es
Mon Feb 19 07:07:39 EST 2007


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")



More information about the Zope mailing list