Moodle, WordPressMU, BuddyPress Single Sign-on Integration

Moodle, WordPressMU, BuddyPress Single Sign-on Integration

Ricky Spears發表於
Number of replies: 5
We are in the process of setting up a community site powered by WordPressMU and BuddyPress. We are planning to integrate Moodle with that in a few months. It seems there are a lot of people wanting to integrate these products, but not a lot of people having success--or at least not sharing their methods if they are successful. 微笑

I became aware of the External DB Authentication plugin for WordPress (http://wordpress.org/extend/plugins/external-database-authentication/) in this thread:
http://moodle.org/mod/forum/discuss.php?d=64452

This seems like it would still require users to have to log in twice and that profiles could be maintained in two places. I'm wanting something a bit more seamless than that. Also, since our WordPressMU site will already be mature when we add Moodle, I prefer to use WordPressMU as the authentication store.

I was reading the documentation about single sign-on (SSO) between Moodle installations. Here is my understanding of how this works for an end user: if I am a member of MoodleSiteA and I visit MoodleSiteB then everything in MoodleSiteB acts as though I'm a member there, but my profile information is still maintained in MoodleSiteA. I wouldn't have to sign in to MoodleSiteB. I could still be added to a class site or anything else and still maintain my profile in MoodleSiteA.

If this understanding is correct, then it seems that the most seamless way to integrate the two products would be to write a WordPressMU plugin that would us the WordPress authentication store in a manner that emulates a Moodle site. Then a SSO connection could be made between a Moodle site and a WordPressMU site in the same manner that a SSO connection could be made between two Moodle sites.

I would also like to create some other plugins to display some information from Moodle on BuddyPress and WordPressMU pages. This type of integration seems to be the best way to accomplish that interaction as well.

In my mind I may also be oversimplyfying the technicalities of doing this--we'll see when I start digging into the code. Other than that though, does anyone see any glaring problems with this approach to integration? Does anyone have any better ideas?
評比平均分數: -
In reply to Ricky Spears

Re: Moodle, WordPressMU, BuddyPress Single Sign-on Integration

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
What you mean is that you are looking to write an MNET module for WordPress. While this isn't likely to be end-of-the-world difficult you might want to think if it is more than you need. MNET uses encryption key pairs and has an automatic key refreshing system. It would also need a reasonable amount of UI in order to configure everything.

It might be simpler just to hack together something more specific. You can still get quite a lot of the idea from the MNET code.

Creating an SSO system is never as simple as people think it ought to be. The general idea runs something like this...

* Wordpress creates a SHA1 (random but unique) token. This is a parameter in a link. When you click the link it refers to a 'landing' script in Moodle.
* Moodle reads the token and passes it straight back to a 'landing' script in Wordpress. Wordpress will have stored the key and the time it was generated. If it exists and is recent (last few seconds) it sends back (to Moodle) a confirmation and the user's profile.
* Moodle creates the user account and/or logs you in.

You can't actually 'emulate' the Moodle site as login relies on sessions - they are locked down so that cookies can only come from the same domain. Therefore Moodle HAS to do it's own logging in but ask WordPress if it is ok. Hence the dialogue.

This isn't the only way but might give you some idea.
In reply to Howard Miller

Re: Moodle, WordPressMU, BuddyPress Single Sign-on Integration

Ricky Spears發表於
That's great information Howard! Thanks!

In our environment, both WordPressMU and Moodle will be, or at least can be, on the same domain. So I was planning on sharing some information between the two using cookies. 微笑
In reply to Ricky Spears

Re: Moodle, WordPressMU, BuddyPress Single Sign-on Integration

Howard Miller發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
You can do that if they are on the same domain but I don't think it's massively more complicated (less in some ways) to do it 'properly' by creating some basic web services. That way if you do decide to move them onto separate domains you can.

I think you'll find it's tricky to emulate Moodle's session creation. I find it more intuitive to 'jump' to Moodle where it can authenticate for itself and logging in is just a function call away.
In reply to Howard Miller

Re: Moodle, WordPressMU, BuddyPress Single Sign-on Integration

Ricky Spears發表於
Thanks again, Howard. I'm glad I posted here before I just started digging in!
In reply to Ricky Spears

Re: Moodle, WordPressMU, BuddyPress Single Sign-on Integration

Aaron Perrell發表於
Hey Ricky,

I'm looking at doing more or less the same thing as you over at the University of Wyoming. I've got WPMU 2.8.4 and BP 1.1 installed and flying with mediawiki SSO and deep integration.

Now we're looking at some LMS to get course ware going. I'm not opposed to having two control panels, so long as there is a link from WPs dashboard to the Moodle control panel and back (editing WPMU dashbaords isn't hard). But my worry is SSO. Visual integration is easy enough- like media wiki I'll force include once the WP header / footer and then tweak what custom CSS remains.

I was wondering if you've made any headway? And/or if you would like to work together?
~ Aaron
http://dighumanities.org
(formally http://thegsn.org)