We are often asked by clients if it would be possible to create a Single Sign-on between their CMS and Moodle or Totara. Since this question has come up a few times for us, I decided to build us a custom adaptor to solve the problem.
I started off by building my own authentication method for Moodle/Totara that would allow pretty much any CMS to connect to it. I also build a small test template that allows me to simulate a CMS passing values to my authentication block. This allows me to test the authentication block on a new installation without needing a CMS present.
Once I had the auth block build, I defined the basic information I would need from a CMS, as well as the route the data would take during the SSO. If you understand this, SSO is not to tricky.
Below are a few steps showing how this was done from Drupal 7.2.x to Moodle 2.6
- Install the ssso auth method to Moodle.
- Log into Moodle and make sure this auth method is enabled.
- Create a block in Drupal containing the necessary fields and URL to the Moodle site.
- Make sure the block is only available to authenticated users.
- I did not make it available to Administrators since I wanted the two sites to have unique administration access rights.
- Add custom fields to Drupal for – firstname, lastname, city and country.
Below are some screen shots showing the process in action.