Single-sign-on (or similar effect) between Moodle and Wordpress

Single-sign-on (or similar effect) between Moodle and Wordpress

by Julie Grundy -
Number of replies: 3

Hi there,

I have an Moodle 2.3 installation at moodle.mydomainname.com with about 2000 users, and a brand new Wordpress installation at mydomainname.com/wordpress/ and I'd like my Moodle users to be able to log in to the Wordpress site using their same Moodle username and password combination.

Ideally this would be a true single-sign-on, where a user can go to either site to login and make updates to their password, etc. The next best option would be to have separate logins but with matching username/passwords.

What are my options?

So far my ideas include:

  1. external database authentication for both Moodle and WP. If so, how do I get the exisiting user info out of Moodle? How will new users and enrolments be created? How are password hash/salting and password changes handled? I cannot find any information about this on the External DB Authentication page, but maybe I'm looking in the wrong place?
  2. external database authentication for WP using Moodle's user table - is this possible?
  3. send WP visitors to Moodle to login then return them to WP once authenticated?

I'm open to suggestions for ways to manage this - as long as users don't have to remember two sets of usernames and passwords, then I'm happy smile

Average of ratings: -
In reply to Julie Grundy

Re: Single-sign-on (or similar effect) between Moodle and Wordpress

by Julie Grundy -

To half-answer my own question, here's something new to me: a Wordpress plugin which will look to Moodle for authentication.

http://wordpress.org/extend/plugins/external-db-auth-reloaded/

Most solutions assume you want Wordpress to be in charge of authentication, but with all my users already in Moodle I want it to be managing that process. If the user is accepted by Moodle, then that's good enough to let them into my Wordpress site.

The drawback is that you need to know the PHP for the password salt. Where would I find that information?

In reply to Julie Grundy

Re: Single-sign-on (or similar effect) between Moodle and Wordpress

by Chris Kenniburg -
Picture of Particularly helpful Moodlers Picture of Plugin developers

You might also want to have a look at LTI.  There is a wordpress plugin that would allow you to create an External Tool activity in moodle and then any users who click on the link are automatically added to the blog as authors. 

I am not sure what your purpose is to have them login to the blog, but this might help if you wanted to create mutliple blogs with specific users from courses in moodle.  Every Moodle Course could have their own blog and the users in Moodle who are in the course can automatically be added to the course blog.

Here is a step sheet on setting it up:

http://webmaster.dearbornschools.org/2012/10/25/wordpress-and-moodle-lti-stepsheet-and-tutorial-for-setup/

In reply to Chris Kenniburg

Re: Single-sign-on (or similar effect) between Moodle and Wordpress

by Julie Grundy -

Thanks for that! I don't need our students to be authors, just to have access to a members-only site. But perhaps it the External Tool can create them as subscribers rather than authors, I'll have a look into it.