-
Notifications
You must be signed in to change notification settings - Fork 25
Rapid Setup
These settings are designed to provide a rapid setup with a minimum number of steps to get a completed install. They assume that you have the ability to add and enable modules, and can make basic edits to your configuration files in both Moodle and Drupal.
The first thing you'll need to do is download the 2.x-2.x of this plugin to the "auth" folder in Moodle. This will provide you with the plugin code you need for Moodle.
Depending on how you've chosen to organize your moodle/drupal environment, you'll need to do some basic modifications to your Drupal site configuration in order for this to work. This is broken down into two options. subdomain based, or subdirectory based. These are described as follows:
if you have chosen to set your site up using subdomains, your urls should look something like this:
moodle.example.com
drupal.example.com
or
training.example.com
www.example.com
The important thing is that each resource (Moodle or Drupal) is accessible directly via a sub domain. If this is the case, you'll need to modify your drupal settings.php file to tell it to share cookies across all subdomains. to do this find the following code block and make the following change:
/**
* Drupal automatically generates a unique session cookie name for each site
* based on its full domain name. If you have multiple domains pointing at the
* same Drupal site, you can either redirect them all to a single domain (see
* comment in .htaccess), or uncomment the line below and specify their shared
* base domain. Doing so assures that users remain logged in as they cross
* between your various domains. Make sure to always start the $cookie_domain
* with a leading dot, as per RFC 2109.
*/
# $cookie_domain = '.example.com';
/**
* Drupal automatically generates a unique session cookie name for each site
* based on its full domain name. If you have multiple domains pointing at the
* same Drupal site, you can either redirect them all to a single domain (see
* comment in .htaccess), or uncomment the line below and specify their shared
* base domain. Doing so assures that users remain logged in as they cross
* between your various domains. Make sure to always start the $cookie_domain
* with a leading dot, as per RFC 2109.
*/
$cookie_domain = '.example.com';
note that the $cookie_domain variable is now uncommented and contains a dot before the domain (be sure to use your domain and not "example.com" when you do this).
This configuration is for Moodle/Drupal environments that occupy the same domain. You would use this if you have the following domain structure:
www.example.com - running Drupal
www.example.com/moodle - running Moodle
or
www.example.com - running Moodle
www.example.com/drupal - running Drupal
or
www.example.com/drupal - running Drupal
www.example.com/moodle - running Moodle
If Moodle or Drupal lives as a subdirectory of your domain, regardless of name, then you are using a subdirectory based configuration. You'll probably need to make one basic configuration change:
/**
* Drupal automatically generates a unique session cookie name for each site
* based on its full domain name. If you have multiple domains pointing at the
* same Drupal site, you can either redirect them all to a single domain (see
* comment in .htaccess), or uncomment the line below and specify their shared
* base domain. Doing so assures that users remain logged in as they cross
* between your various domains. Make sure to always start the $cookie_domain
* with a leading dot, as per RFC 2109.
*/
$cookie_domain = 'www.example.com';
note that there is no leading dot, and the full domain is there. This is important to prevent the cookie being issued to a subdirectory. If that happens the cookie could be valid at www.example.com/drupal ensuring that www.example.com/moodle could not see it. The above will resolve that issue.
You'll need to do the following steps regardless of the configuration set up above. This is the part where the actual Drupal site is configured to supply data to moodle when moodle requests it.
To begin, you will need to get a few additional modules. The following list is required at a minimum in order for this to work:
Features ( http://drupal.org/project/features ) Moodle SSO ( http://drupal.org/project/moodle_sso )
The only important module to enable in Drupal at this point is "Moodle SSO".
Lastly, you'll need to create a user that this service can log in as. It shouldn't have any special permissions, just a user who's username and password you can be reasonably comfortable storing in moodle. It should have the "Service-Authentication" role associated with it.
Thats it for the Drupal side of things!
In this step, you'll need to be comfortable enabling moodle plugins and following instructions on a screen. here's what to do:
- enable the drupalservices auth plugin.
- go to the configuration page for the drupalservices plugin.
- fill out as much as you can, then hit save.
- return to the configuration page, and read the status messages. Fix any problems that might be recommended, then hit save.
- repeat steps 3 and 4 till everything says success.