Suresh
August 25, 2015
Moodle is a free and open-source software learning management system written in PHP and distributed under the GNU General Public License. Moodle is used for blended learning, distance education, flipped classrooms, and other e-learning projects in schools, universities, workplaces, and other sectors.
Our main objective is that we wanted to manage all the users from Drupal i.e., use drupal as the front end for managing users. For this purpose, we have a moodle plugin and Drupal module. Drupal services is a moodle authorization plugin that allows for SSO between Drupal and Moodle. Moodle SSO provides the Drupal functionality required to allow the Moodle training management system to SSO share Drupal sessions.
In order to make SSO work, we need to ensure that sites can share cookies. Drupal and moodle sites should have urls like drupal.example.com and moodle.example.com. As mentioned earlier, sites should be able to share cookies. To make sites use a shared cookie, we need to set the value of $cookie_domain in a settings.php file on the drupal site. In our case, the site URLs were something like drupal.example.com and moodle.example.com. For these types of sub-domains, the cookie_domain value can be set like the below one:
$cookie_domain = ".example.com";
Note: The dot before "example.com" is necessary.
Let's start with the steps that need to follow for achieving SSO (single sign-on) between drupal and moodle:
We wanted to import all the users from moodle to drupal. For this, we created a custom local plugin based on web service. From the drupal site, we made a call to the web service function and got the list of all users in moodle. Using this list of users, we created them on the Drupal site.
The Drupal Moodle user integration is just a first step in the arena. We at Knackforge have worked on Course, Certificate integration between Moodle and Drupal. We would share that experience in the upcoming posts.
Just like how your fellow techies do.
We'd love to talk about how we can work together
Take control of your AWS cloud costs that enables you to grow!