Forums | Mahara Community
Mahara/Moodle integration
/
Integration Problems (Mahara/Moodle SSO with AD)
01 June 2009, 4:03
Good Morning all, I hope you are all well and my thanks to you for taking the time to read my post.
I'm trying to integrate Moodle and Mahara in the smoothest fashion possible.
My goal was to have my Active Directory backend be the authentication mechanism for both Moodle and Mahara (works) with SSO in both directions between Moodle and Mahara if this was possible?
On Friday I was able to achieve SSO from Moodle (auth back to AD) into Mahara through SSO which worked perfectly.
Today, I configured Mahara to authenticate to AD in addition to XMLRPC & Internal which works but if you then if you try to log into Moodle and arrive at Mahara via the SSO Link mahara gives an nonrecoverable error.
Below is my apache log file (I'm not concerned over the security of posting any information from it as this is a proof of concept system).
Thank you very much indeed for your time, I am most grateful.
Kim.
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] [WAR] 89 (lib/errors.php:663) Failed to get a recordset: mysql error: [1062: Duplicate entry 'brionyadam' for key 2] in adodb_throw(INSERT INTO "usr" ("username", "password", "salt", "passwordchange", "active", "deleted", "expirymailsent", "lastlogin", "inactivemailsent", "staff", "admin", "firstname", "lastname", "studentid", "preferredname", "email", "quotaused", "authinstance", "sessionid") VALUES ('brionyadam', '', '', 1, 1, 0, 0, '2009-06-01 10:00:43', 0, 0, 0, 'Briony', 'Adam', '', '', '[email protected]', 0, '2', ''), ), referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] [WAR] 89 (lib/errors.php:663) Command was: INSERT INTO "usr" ("username", "password", "salt", "passwordchange", "active", "deleted", "expirymailsent", "lastlogin", "inactivemailsent", "staff", "admin", "firstname", "lastname", "studentid", "preferredname", "email", "quotaused", "authinstance", "sessionid") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and values was (brionyadam,,,1,1,0,0,2009-06-01 10:00:43,0,0,0,Briony,Adam,,,[email protected],0,2,), referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] Call stack (most recent first):, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * log_message("Failed to get a recordset: mysql error: [1062: Dup...", 8, true, true) at /var/www/mahara/lib/errors.php:90, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * log_warn("Failed to get a recordset: mysql error: [1062: Dup...") at /var/www/mahara/lib/errors.php:663, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * SQLException->__construct("Failed to get a recordset: mysql error: [1062: Dup...") at /var/www/mahara/lib/dml.php:1023, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * insert_record("usr", object(stdClass), "id", true) at /var/www/mahara/auth/user.php:343, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * User->commit() at /var/www/mahara/lib/user.php:1233, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * create_user(object(User), array(size 0), "mahara", object(AuthXmlrpc), "brionyadam") at /var/www/mahara/auth/xmlrpc/lib.php:219, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * AuthXmlrpc->request_user_authorise("d44cbb0d4c9ef41ba67e5f20ce77756b43565da3", "http://moodle/moodle") at /var/www/mahara/auth/xmlrpc/land.php:95, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] , referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] [WAR] 89 (lib/dml.php:1023) Failed to get a recordset: mysql error: [1062: Duplicate entry 'brionyadam' for key 2] in adodb_throw(INSERT INTO "usr" ("username", "password", "salt", "passwordchange", "active", "deleted", "expirymailsent", "lastlogin", "inactivemailsent", "staff", "admin", "firstname", "lastname", "studentid", "preferredname", "email", "quotaused", "authinstance", "sessionid") VALUES ('brionyadam', '', '', 1, 1, 0, 0, '2009-06-01 10:00:43', 0, 0, 0, 'Briony', 'Adam', '', '', '[email protected]', 0, '2', ''), ), referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] [WAR] 89 (lib/dml.php:1023) Command was: INSERT INTO "usr" ("username", "password", "salt", "passwordchange", "active", "deleted", "expirymailsent", "lastlogin", "inactivemailsent", "staff", "admin", "firstname", "lastname", "studentid", "preferredname", "email", "quotaused", "authinstance", "sessionid") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) and values was (brionyadam,,,1,1,0,0,2009-06-01 10:00:43,0,0,0,Briony,Adam,,,[email protected],0,2,), referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] Call stack (most recent first):, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * insert_record("usr", object(stdClass), "id", true) at /var/www/mahara/auth/user.php:343, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * User->commit() at /var/www/mahara/lib/user.php:1233, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * create_user(object(User), array(size 0), "mahara", object(AuthXmlrpc), "brionyadam") at /var/www/mahara/auth/xmlrpc/lib.php:219, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] * AuthXmlrpc->request_user_authorise("d44cbb0d4c9ef41ba67e5f20ce77756b43565da3", "http://moodle/moodle") at /var/www/mahara/auth/xmlrpc/land.php:95, referer: http://moodle/moodle/
[Mon Jun 01 10:00:43 2009] [error] [client 192.168.1.10] , referer: http://moodle/moodle/
01 June 2009, 10:09
A bit of further diagnosis.
Fresh user in Active Directory, log onto Mahara no problem, navigate out to moodle no problem. Log out. Log same user into moodle and back into mahara and you get the error.
Reverse the circumstances, new user into Moodle first, then over into Mahara, log out and back into Mahara and through to Moodle no problem.
Something I can't quite get my head around.
Grateful for any assistance.
Kim.
02 June 2009, 0:29
Hi. There's not really a nice way to do 'two way SSO', I think your attempts to do it are what's causing the crashes.
Though the UI for configuring the XMLRPC errorneously suggests you can do this by both having 'We SSO Out' and 'They SSO In' checkboxes, the reality is that you should only use one at a time.
You can set it up so that users can use the login form on both ends using their AD details though, even when only SSOing one way. For more information on how to set this up, I suggest you find and read the Mahoodle documentation (through google) - there is a very good PDF explaining how the SSO works.
Let us know how you get on!