A brief video shows how the MSG-Moodle authentication works.
If the user is not logged in, they are automatically logged in to MSG. This happens by sending the MSG server the users current Moodle cookie. The MSG server then validates this cookie (by calling the validate.php service in MSG-Moodle block) and creates for the user an MSG session ID. A background process then starts on the MSG server to update the user and group membership information using the users.php and groups.php services in MSG-Moodle block.
- GetGlobalContacts – updates the number of users on and offline from a service on MSG-Moodle block
- GetPersonalContacts – updates the number of users personal contacts who are on and offline from a service on MSG-Moodle block
- Peek – This connects to the BuddyXML service on the MSG server to monitor for notifications of presence state changes and for new messages received. The peek process opens a connection to the BuddyXML server, this connection is held open while waiting for a response from BuddyXML. BuddyXML will repond either after 45 seconds (timeout setting) or if a presence state change occurs or is a new message is received, which ever is sooner. If a presence state change notification is received then the presence icon is updated for the relevant user. If a new message is recvied for the currently logged in user then the users presence icon is updated with an exclamation mark. The reason for holding the connection open in this way is so that the BuddyXML doesn’t need to return all the users contacts presences, which could be quite a large data set if the user had a lot of contacts, so instead only changes to presences are returned.
The timeouts for all these processes can be adjusted using the MSG-Moodle block settings.
MSG-Moodle uses JSON style (see: http://en.wikipedia.org/wiki/JSON) services to communicate with an MSG server. MSG-Moodle also provides services to the MSG server to populate the user and group memberships in Openfire. Users groups are automatically created based on their enrolments to Moodle courses.