Google sign-in for multiple moodle sites

Google sign-in for multiple moodle sites

by Kenia Delgado -
Number of replies: 2

Moddle version: 2.5.1

Hi! I am currently working on a solution for the school I work at (UACh) that involves creating a single log-in for all moodle platforms, what we would like to achieve is to log-in a user to multiple moodle sites but only with a single google sign-in session.

The way the app works is: first the user logs to a panel that displays all the courses they have (we have users that have courses up to 3 different sites for example), and then we generate links to those courses for them to click and redirect to the moodle course they want in the specific moodle site the course is (they don't log in again, because in the app log-in to the panel, this is done already).

This single login was already achieve but using ldap identification in two ways:

1- From the first log-in to the panel, from where we log the user to the sites they are enrolled using the credentias they give.

2 - They log-in to the panel, and in the links to their courses is a POST that sends the credentials to the moodle site and then logs the user and redirects to the course they want

We are looking for an alternative log-in way using google sign-in, so we could protect our users credentials better.

We would like to log the user to the moodle platforms from the first log-in to the panel (or even only when they click the links from the panel). We successfully incorporate google sign-in to the login for the panel, but now we don't know how to log the user to the moodles without having them use the google sign-in account selector for each moodle they pretend to enter (like I mention we have users with courses up to 3 sites) , we can't get the password from the google sign-in addition, so we can't sent the credentials to log them in.

I don't know if someone has already achieve this, if someone has I would be really grateful if you could help us out to achieve this ourselves! or even if someone has useful tips or ideas, would be helpful to!



Average of ratings: -
In reply to Kenia Delgado

Re: Google sign-in for multiple moodle sites

by Ken Task -
Picture of Particularly helpful Moodlers

First, higher versions of moodle have Google Oauth2 built in - part of core code.   No addons needed.

You might shift your thinking ... you are an Edu - why not acquire a Google For Education domain and require the students in your moodles to use credentials from/for that domain ... which could be sync'd from LDAP.

https://support.google.com/a/answer/106368?hl=en

As far as what you are calling 'single sign on', don't think you want student to login to let's say Moodle A and have it auto login students @Moodle B and @Moodle C at the same time.   There's are session cookies, tokens, and time outs in every Moodle.

Now if they logged onto Google and were in Moodle A - deep linking to a students course would still present them with situation where they must initiate a login ... that starts a session, acquires a cookie, etc.  but student won't have to provide credentials cause Moodle B see's they have already authenticated with Google.

Of course, this is 2 cents worth of advice/suggestion!

'spirit of sharing', Ken


In reply to Ken Task

Re: Google sign-in for multiple moodle sites

by Kenia Delgado -
Hi Ken!

I actually forgot to mention that our testing has been with moodle 3.3 (we are migrating versions!) we included that successfully, we actually have a google domain for edu, the platform (our single sign in app) does not start session unless the students/ profesor clicks the course link in our panel so they are prevented from starting the sessions in moodle sites they don't need.

We also implemented the sync tool you tell me about, we are looking more into google because we want to switch our old ldap authentication because is quite old and we want an alternative place if we ever have to put it down or change it at some point (so we keep the service active always).

Thank you for your advices and suggestions!