Fantastic to see that there is some movement towards integrating moodle.
I'd given up on the single-sign-on module.
I'm new to drupal, and have only tried D6, so I don't know anything about this module
from its D5 version. Can anyone explain what kind of integration the module provides?
Really, all I'm looking for is a single-sign-on. Even better would be not having to create
a moodle account at all, but to have it use the drupal one automatically.
Anything else above and beyond that is bonus!
Cheers.
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | course.zip | 8.56 KB | wvd_vegt |
Comments
Comment #1
tebb commentedOne of the things it does is allow Moodle to use Drupal usernames and passwords to sign on. I don't understand it much more than that.
I'm not sure if you can register with M and then sign into D for instance or if you HAVE TO register through D.
If you download and unzip the package, there's an install.txt which gives an idea of what it does, but :
1) I agree, it looks awesome! (I tried integrating Moodle with 'another CMS' a long time ago, maybe before external db auth was available)
2) The module description would be much improved if it said what it does do, doesn't do and planned improvements (if any).
3) I'd be grateful for a brief idea of what the index_dr.php file is doing as I couldn't follow it. Doh. (Directory replication?)
Many thanks for this work.
Comment #2
Chris Johnson commentedI'll try to get to all of the suggestions and questions asked. I'm spending a great deal of my time on this module now for my employer. We have a customer who uses Drupal -> Moodle integration under Drupal 4.7 in a very primitive fashion. We are now working on moving all of that software (not just the Drupal -> Moodle stuff, but maybe 70 to 80 modules) to Drupal 6.
Single Sign-On (SSO) is hard to do, in general, and Drupal/Moodle are no exception.
Right now, we have Drupal and Moodle both authenticating from the same LDAP server. That means the users have the same usernames and passwords on both Drupal and Moodle. Using this module, we are able to display Moodle within an iframe on the Drupal page. Unfortunately, the user still has to log in a second time when they navigate to the Moodle iframe from a link on the Drupal site, because we don't have SSO.
The code in this module and index_dr.php allows the user/password to be passed via an HTTP GET in the URL. This is not the best security, and we don't presently use this feature.
Another possibility for SSO is to use "external db auth" from Moodle. That means Moodle has to have access to the Drupal database to auth, but that alone won't prevent the user from having to login a second time, as its essentially like our LDAP setup. But there may be some additional code out there which will make this into SSO. Our problem is we don't want to give Moodle access to the Drupal database. We are not confident in Moodle's security, compared to Drupal's (e.g. avoiding SQL injection, etc.).
My top priority for enhancements is to make this module support real SSO in our environment. That's what our customer wants, and obviously is very desirable from a usability point of view.
Hope this helps a bit.
Comment #3
tebb commentedThanks Chris for the explanation. Great to hear that someone is getting paid to upgrade some of the 60-80 modules! ;)
The MoodleSSO Drupal project has some ideas about achieving SSO (of course) and I'm sure you've looked at these. It mentions 'lazy account creation' amongst other details, but seems to have fizzled out.
Given the number of Moodle users, if you can achieve this and release it as a D6 module, I'm sure that would further improve Drupal's popularity.
Best of luck,
Dru-p
Comment #4
don@robertson.net.nz commentedHi -
Interesting to hear what the module is supposed to do. I do not seem able to get any of it working.
Does the moodle installation have to be in a subdirectory of the Drupal installation?
I don't get any blocks or see any way to add links to the moodle content.
At the moment, I can share passwords by setting the moodle authentication to use the Drupal database, but I do not need a module in Drupal to do that.
Comment #5
socialnicheguru commentedsubscribing... great information
Comment #6
Chris Johnson commentedNo, the Moodle installation does not need to be a in subdirectory of the Drupal installation, but it does need to be in a place that can be referenced relative to the Drupal document root. Some of this depends on your web server and its configuration. Here's what we do to make it work in our environment. We use a symlink.
All of our document roots for all of our Apache virtual hosts are in /var/www/. So if we just look at one Drupal install and one Moodle install, it might look like this:
In the admin->settings->moodle page, the Moodle directory is specified as "/lms_moodle". The field takes a relative path to the install, so in theory "../moodle" ought to work, too.
Comment #7
don@robertson.net.nz commentedOkay - your theory is correct. Using ../ works even if they are on seperate sub-domains.
I can now access moodle through http:///moodle (full page) or ?q=moodle (embedded) even though my moodle sub domain is not in the hosts file on this machine, and I can not access it directly.
I am using Drupal 6 and the dev module on a test set up.
With a bit of luck I will be working with Drupal and Moodle more in the future - so hope I can give you a hand :-)
Don
BTW - some documentation would eb nice :-)
Comment #8
zeezhao commentedsubscribing. thanks
Comment #9
andrés chandía commentedWaiting for the same answer than Don Robertson
Comment #10
Chris Johnson commentedHere is one way to get single-signon between Drupal and Moodle. It's not the most beautiful method, but it works for us at the moment. It uses OpenID, with Drupal as the OpenId provider/server and Moodle as the relying-party/client.
To make it work, you'll need at a minimum:
1. Install Drupal's openid_provider module and patch it with the recent critical patches posted by me and Darren Ferguson. The current release of the openid_provider module is "broken" with respect to correctly implementing the OpenId protocol such that clients other than Drupal itself can work with it.
2. Install the Moodle OpenId authentication module, which comes with both plain vanilla OpenId and an OpenId SSO option. Using the SSO option, properly configured to specify your Drupal site as the server will allow single signon to happen.
3. You'll need to make one small change to the Moodle OpenId module to work around a shortcoming in the Drupal openid_provider module that does not allow it to handle compatibility requests correctly. This simple change forces Moodle to always use the OpenId v2 protocol. Since Drupal supports v2, having a compatibility mode with v1 is unneeded here. The change is:
In file auth/openid_sso/auth.php around line 217, change this:
$endpoint->type_uris = array(Auth_OpenID_OPENID1_NS);to this:
$endpoint->type_uris = array(Auth_OpenID_TYPE_2_0);Comment #11
roball commentedHi Chris,
did you only solve the SSO problem via OpenID yet? Or did you also have some progress with LDAP server auth?
Comment #12
roball commentedChris, did you check G.W. van der Vegt's modified version of the moodle module for Drupal 6.x, from October 3, 2008, posted at http://drupal.org/node/80982 ? Would you like to release an updated version of your 6.x-1.x-dev module that includes the enhancements?
Comment #13
wvd_vegt commentedHi,
I do not have any idea how to zip into appropriate tar.gz format (sorry). I've attached a zip file containing the code.
Btw especially for Moodle we also created a dropdown menu to get rid of the left/right areas normally stuffed with blocks. It builds the menu dynamically based on course structure.
This menu is used in conjunction with a new course format called 'topic' that is the non plural version of the topics format. This way moodle is extremely quite and accessible when embedded in Drupal.
Comment #14
roball commentedThank you Wim for posting your "course" module. Is it based on the 6.x-1.x-dev version of the "moodle" module published by Chris Johnson on Aug. 19, 2008? I didn't have a look into either of them yet. Is the "course" module meant to be a replacement of the "moodle" module or an extension?
Comment #15
andrés chandía commentedI was following the instructions that Chris Johnson gives at post #6 but i could arive till the same point that Don Robertson did, I'm reading the posts after those but now I'm getting a little confused, because I don't know now to wich version of Drupal and Moodle can I apply all of this, anyway my versions are:
Drupal 6.9
Moodle 1.9.4
Can I intend to apply Drupal/Moodle Integration with these vesions?
Thanks for your help and for all of your effort.
Comment #16
wvd_vegt commentedHi,
It's a port & enhancement of the older Drupal 5 version.
Comment #17
roball commentedI see - but Chris Johnson also ported the Drupal 5 based module to Drupal 6 and released it as version "6.x-1.x-dev". I think both ports should be merged into one module officially available under drupal.org, to reduce confusion and make them more trusted. When I see code like
in this module, I have big concerns about security. This is one reason I did not install either of these two modules. Nobody should even ever think about passing a password via GET (or other openly readable ways).
Comment #18
wvd_vegt commentedHi,
I agree: But:
1) The password is a md5 hash in cleartext so not that readable after all.
2) Logging into moodle directly with this also won't work as the normal moodle login hashes the password yet again rendering it useless.
3) The url is generated by drupal for the iframe. The moodle login page redirects away after loging in, wiping the url clean.
Moodle is configured for 'cleartext' login as it needs to compare the already md5'ed password it gets passed with the drupal user table. There is however not much readable cleartext in it. And it's much more secure than the average base64 encode of plaintext password with normal browser authentication.
If you have a better method, please suggest it.
Comment #19
roball commentedWim,
I wrote a Block for Drupal 6.x that single-signs-on to Moodle using user authentication from an LDAP server. Neither Drupal, nor Moodle stores passwords in their user tables. The password will be fetched from the LDAP server each time at login time. Moodle does not need to be altered in any way - so it works with Moodle stock installations "out of the box" :-) A description can be found on the Moodle forums here:
http://moodle.org/mod/forum/discuss.php?d=116295
Best regards,
rob.
Comment #20
Panda_N_Shark commentedHy rob
Can you please share your code?
Thanks in advance
Comment #21
roball commentedYes Panda! But for now, I would prefer to continue discussion at the Moodle forum's thread posted above. So could you please join there?
Comment #22
Chris Johnson commentedWe are only using OpenID for SSO authentication to Moodle. The LDAP authentication plugin does not provide SSO capability as is. I'm would think someone could modify the LDAP plugin to support SSO, but have not looked at doing that myself.
Comment #23
Chris Johnson commented#15, Andrés: we are using Drupal 6.7 and Moodle 1.9.3+. I'm sure Drupal 6.9 will work also. Moodle 1.9.4. should also work fine.
Comment #24
Chris Johnson commentedMoodle Single Signon (SSO)
I am also now the maintainer of the moodlesso module. Let's try to gather together all the possible SSO schemes and code as issues for that module, and leave the moodle module for other Drupal / Moodle integration ideas.
Comment #25
Chris Johnson commented