Forums | Mahara Community

Mahara/Moodle integration /
Unalbe to sign in via SSO


anonymous profile picture
Account deleted
Posts: 4

02 August 2011, 4:59

Hello mahara/moodle users,

We're having some difficulties with the moodle/mahara* connection.
We've set up the connection as described in the manuals. Roles are defined, etc..

Everthings 'working' until an user wants to SSO to mahara.
In moodle the user clicks on te link tot mahara. The page opens, but we get an error:

Unable to sign in via SSO:

*  Your SSO session might have expired.
** You may not be allowed to SSO to Mahara.

This happens every time, with every user. Even with the Admin.
Does anyone have the same problem and maybe a solution?

This is the url from the networking/network servers block: 
http://localhost/moodle21/auth/mnet/jump.php?hostid=3


This is the url created/linked by mahara:
http://localhost/mahara/auth/xmlrpc/land.php?token=5834dd6546f47c3e9e8fe2db4e03f7e099a25b0e&idp=http://localhost/moodle21&wantsurl=

I've tried different possible solutions, but nothing helped so far...

Greetz,

JW

* Moodle 2.1 & Mahara 1.4

Mahoodle

anonymous profile picture
Account deleted
Posts: 214

02 August 2011, 5:07

Hi JW,

I'll skip the question of whether your servers have their time in sync since you're going localhost to localhost.

Could you check your web server's error log. If you're running OS X, I think that it's stored in /usr/local/apache2/logs/error_log  but I may not be right.

Most SSO errors are reported in the error log.

Andrew

anonymous profile picture
Account deleted
Posts: 4

02 August 2011, 5:42

I find this in the error_report:

  • [Tue Aug 02 12:36:22 2011] [error] [client ::1] [WAR] 53 (api/xmlrpc/client.php:128) Undefined variable: payload, referer: http://localhost/moodle21/
  • [Tue Aug 02 12:36:22 2011] [error] [client ::1] Call stack (most recent first):, referer: http://localhost/moodle21/
  • [Tue Aug 02 12:36:22 2011] [error] [client ::1]   * log_message("Undefined variable: payload", 8, true, true, "/Applications/XAMPP/xamppfiles/htdocs/mahara/api/x...", 128) at /Applications/XAMPP/xamppfiles/htdocs/mahara/lib/errors.php:446, referer: http://localhost/moodle21/
  • [Tue Aug 02 12:36:22 2011] [error] [client ::1]   * error(8, "Undefined variable: payload", "/Applications/XAMPP/xamppfiles/htdocs/mahara/api/x...", 128, array(size 11)) at /Applications/XAMPP/xamppfiles/htdocs/mahara/api/xmlrpc/client.php:128, referer: http://localhost/moodle21/
  • [Tue Aug 02 12:36:22 2011] [error] [client ::1]   * Client->send("http://localhost/moodle21") at /Applications/XAMPP/xamppfiles/htdocs/mahara/auth/xmlrpc/lib.php:118, referer: http://localhost/moodle21/
  • [Tue Aug 02 12:36:22 2011] [error] [client ::1]   * AuthXmlrpc->request_user_authorise("60fbb67639e930c2e7663ffac8e14f234fba56f5", "http://localhost/moodle21") at /Applications/XAMPP/xamppfiles/htdocs/mahara/auth/xmlrpc/land.php:94, referer: http://localhost/moodle21/
  • [Tue Aug 02 12:36:22 2011] [error] [client ::1] , referer: http://localhost/moodle21/

Do you know this error?

JW

anonymous profile picture
Account deleted
Posts: 214

02 August 2011, 5:57

Hi JW,

I've not come across this error before. Looking at the code, I think that your Moodle is sending invalid SSO details back. It's a while since I've looked in any details at the mnet/xmlrpc authentication side of things and this could be an edge-case bug.

If you're in a position to add a bit of debugging, could you add:

log_debug($xml);

after line 127.

It looks like the $payload variable is not being set if the message is neither encrypted or signed. Why it isn't encrypted or signed is another  matter though, and I'm hoping that a dump of the data returned by moodle ($xml) will give us a pointer.

The output from this should appear in your error log when you try and SSO again.

Andrew

anonymous profile picture
Account deleted
Posts: 4

02 August 2011, 6:09

Hi Andrew,

The error report is a lot longer:

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) SimpleXMLElement Object, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)     [fault] => SimpleXMLElement Object, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)         (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)             [value] => SimpleXMLElement Object, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                 (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                     [struct] => SimpleXMLElement Object, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                         (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                             [member] => Array, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                 (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                     [0] => SimpleXMLElement Object, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                         (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                             [name] => faultCode, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                             [value] => SimpleXMLElement Object, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                                 (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                                     [int] => 7023, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                                 ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                         ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                     [1] => SimpleXMLElement Object, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                         (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                             [name] => faultString, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                             [value] => SimpleXMLElement Object, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                                 (, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                                     [string] => mnet/encryption-invalid, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                                 ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                         ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                                 ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                         ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)                 ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128)         ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) ), referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [DBG] 03 (api/xmlrpc/client.php:128) , referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] [WAR] 03 (api/xmlrpc/client.php:129) Undefined variable: payload, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] Call stack (most recent first):, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1]   * log_message("Undefined variable: payload", 8, true, true, "/Applications/XAMPP/xamppfiles/htdocs/mahara/api/x...", 129) at /Applications/XAMPP/xamppfiles/htdocs/mahara/lib/errors.php:446, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1]   * error(8, "Undefined variable: payload", "/Applications/XAMPP/xamppfiles/htdocs/mahara/api/x...", 129, array(size 11)) at /Applications/XAMPP/xamppfiles/htdocs/mahara/api/xmlrpc/client.php:129, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1]   * Client->send("http://localhost/moodle21") at /Applications/XAMPP/xamppfiles/htdocs/mahara/auth/xmlrpc/lib.php:118, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1]   * AuthXmlrpc->request_user_authorise("d752bf88ccf35ba3861852c35b746c65d22acb90", "http://localhost/moodle21") at /Applications/XAMPP/xamppfiles/htdocs/mahara/auth/xmlrpc/land.php:94, referer: http://localhost/moodle21/

[Tue Aug 02 13:04:18 2011] [error] [client ::1] , referer: http://localhost/moodle21/

JW
anonymous profile picture
Account deleted
Posts: 214

02 August 2011, 6:28

Hi JW,

The key bit here is the faultCode and matching faultString. These are:

faultCode: 7023
faultString: encryption-invalid

These are being reported by Moodle in mnet/xmlrpc/serverlib.php.

This should only happen if there was an issue with the MNet Certificate and/or Key.

Could you check that the SSO keys are correct in both Moodle and Mahara. You may need to reset them, but initially just check that the correct keys are in Moodle and Mahara.

Andrew

anonymous profile picture
Account deleted
Posts: 4

02 August 2011, 6:37

Hey Andrew,

I feel a bit Embarassed, but indeed, my keys were different (for some reason)
Now it works fine!

Sorry for the trouble & thanks for helping.

JW

anonymous profile picture
Account deleted
Posts: 214

02 August 2011, 8:26

heh it's all fine! :)

Unfortunately the MNet authentication mechanism is complicated and difficult to debug. You may have seen that Moodle has already decided to move away from (and provide an alternative to) the current MNet implementation in the near future.

Andrew

8 results