Moodle Networking

Moodle Networking

by Ian Robotham -
Number of replies: 5
Hi all,

I'm having some problems with Moodle Networking and hoping that somebody can shed some light.

I have successfully got Moodle - Mahara working fine. However I am now trying to set up Moodle networking between two Moodles. What I need is one moodle instance (elearning) to share all it's courses with another (portal). elearning will also have regular users added to it. elearning should not be able to access or see portal.

I've got most of it set up and running - portal and elearning can communicate and I have got a remote enrollment on portal to one of elearnings courses. However when I try and do a hop from portal to elearning I get the following error message:

RPC auth/mnet/user_authorise:User with ID 1622 attempted to call unauthorised method auth/mnet/auth.php/user_authorise on host portal ERROR 7:7:User with ID 1622 attempted to call unauthorised method auth/mnet/auth.php/user_authorise on host portal.

This shows up on both an admin and a regular student account and are shown from an elearning address. However the accounts are created on the remote system.

On elearning:
portal services:
MNet Enrollment: Publish
SSO (IP): Subscribe
SSO (SP): Publish

On portal:
elearning services:
MNet Enrollment: Subscribe
SSO (IP): Publish
SSO (SP): Subscribe

elearning and portal use exactly the same files (currently a 1.9.4 build) as we have a config in place to detect which database & config file to use. They reside on the same servers (we have a load balancing arrangement of I think 6 or 7 servers). The server config is RHEL, Apache 2, PHP 5 & MySQL.

I'd be really grateful if anybody can figure out what is wrong - let me know if you need more information.

Cheers,
Ian
Average of ratings: -
In reply to Ian Robotham

Re: Moodle Networking

by Penny Leach -
Hi Ian,

Have you enabled the mnet authentication plugin ? I think you have to enable it in "elearning", but I might be wrong.

In reply to Ian Robotham

Re: Moodle Networking

by Valery Fremaux -

Hi Ian,

enabling course remote enrollment service IS NOT ENOUGH :

For users roaming between your two nodes, you NEED allowing both SSO services to communicate : You will only be allowed to apply for a remote course if your identity can pass thru the MNET gate witjh proper authentication. This is the purpose of that two services.

The first one calles Identity provider allows each Moodle to communicate the complete (not so complete) profile to the other platform to create peer accounts, the other one is used at jumping time.

Cheers. 

In reply to Valery Fremaux

Re: Moodle Networking

by Ian Robotham -
Hi All,

Thanks for your messages. Moodle Networking authentication is enabled on both instances. The only differences being:
  • portal has "Auto add remote users" set to no whereas elearning has it set to yes.
  • portal has LDAP authentication enabled as well and appears above Moodle Networking
I have also got ticks in every box under services on both hosts. Still no joy!

Doing a bit of digging:
  • Clicking the link in Network Servers takes me to [HIDDEN]/elearning/auth/mnet/land.php?token=cdf0ff5ce156e05093e74abed3c7314fe25f3db8&idp=[HIDDEN]/portal&wantsurl=
  • Looking at the code in land.php I see confirm_mnet_session and track the error message down as coming from line 276. So the test (($mnetrequest->send($remotepeer) === true) has failed.
  • Looking further this is a result of
SELECT
*
FROM
{$CFG->prefix}mnet_rpc r,
{$CFG->prefix}mnet_service2rpc s2r,
{$CFG->prefix}mnet_host2service h2s
WHERE
r.xmlrpc_path = '{$this->method}' AND
s2r.rpcid = r.id AND
s2r.serviceid = h2s.serviceid AND
h2s.subscribe = '1' AND
h2s.hostid in ({$id_list})";
  • returning no records. Echoing the SQL gives me $id_list of 1,2. But in my database for elearning the id of the remote host is 3. I did a print_r of the $mnet_peer object which is used to get the id and looking at it, it appears to be from the database which supports portal and not elearning. Have I got confused and this is right? Or is it getting the records from the wring database (possibly caused by our config hacks to use the same code files?)
Thanks again for your time,
Ian
In reply to Ian Robotham

Re: Moodle Networking

by Ian Robotham -
Quick update...

I've got it working talking to another instance of Moodle hosted on the same servers but using different files, so I'm almost certain the problems are due to hack we have in place to reuse the same files, so I'll see if I can fix that. Failing that we'll just have to run a couple of versions.

Thanks again for all your help,
Ian