Your Moodle version

Authentication: Google / Facebook / Github / Linkedin / Windows authentication

auth_googleoauth2
Maintained by Picture of Jérôme Mouneyrac Jérôme Mouneyrac
Sign-in with your Google / Facebook / Github / Linkedin / Windows Live account. The first time you sign-in, a new account is created.
Moodle 2.1, 2.2, 2.3, 2.4, 2.5

Sets

This plugin is part of set OAuth2. Plugins from the set work the best when installed together.

This plugin adds the "Sign-in with Google / Facebook / Github / Linkedin / Windows Live" buttons on the login page. The first time the user login with a social account,  a new Moodle account is created.

Installation:

  1. add the plugin into /auth/googleoauth2/
  2. in the Moodle administration, enable the plugin (Admin block > Plugins > Authentication)
  3. in the plugin settings, follow the displayed instructions.
  4. Add the following code to your login page :

<?php require_once($CFG->dirroot . '/auth/googleoauth2/lib.php'); auth_googleoauth2_display_buttons(); ?>

Most of you will need to copy the code at the bottom of login/index_form.html. Some custom themes have their own login page. In this case you should find the login layout page indicated in the theme config.php file. Often the file location is something like /theme/YOURTHEME/layout/login.php.

More information

More information on the official web site.

 

 

 

Screenshots

Screenshot
Screenshot

Contributors

Picture of Jérôme Mouneyrac
Jérôme Mouneyrac (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of Jérôme Mouneyrac
    Tue, Sep 24, 2013, 11:04 PM
    Just a reminder, if possible do not report issues here but on the github: https://github.com/mouneyrac/moodle-auth_googleoauth2/issues?state=open

    Also when reporting issue don't hesitate to turn debug mode ON in moodle, and give the full error message. Also mention your environment it can help to resolve an issue.

    On github there is also a wiki/faq: https://github.com/mouneyrac/moodle-auth_googleoauth2/wiki

    Thanks smile
  • Picture of Darrel Tenter
    Thu, Nov 21, 2013, 8:41 AM
    I'll report isses to github if needed, but I'm not sure if these are bug issues, or configuration issues on my end.

    I'm running Moodle 2.5.3+ (Build: 20131115)

    I've just installed the plugin. I am able to login with Facebook and Google.

    For LinkedIn I'm getting "Error writing to database". Here's the anonymized debug info:
     Debug info: Column 'country' cannot be null
    UPDATE mdl_user SET email = ?,firstname = ?,lastname = ?,country = ?,city = ? WHERE id=?
    [array (
    0 => 'linkedinuser@domain.com',
    1 => 'First',
    2 => 'Last',
    3 => NULL,
    4 => NULL,
    5 => '17',
    )]
    Error code: dmlwriteexception
    Stack trace:
    line 426 of /lib/dml/moodle_database.php: dml_write_exception thrown
    line 1195 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
    line 1227 of /lib/dml/mysqli_native_moodle_database.php: call to mysqli_native_moodle_database->update_record_raw()
    line 371 of /auth/googleoauth2/auth.php: call to mysqli_native_moodle_database->update_record()
    line 88 of /login/index.php: call to auth_plugin_googleoauth2->loginpage_hook()
    Output buffer: Notice: Undefined property: stdClass::$country in /var/www/vhosts/mysite.com/httpdocs/auth/googleoauth2/auth.php on line 326 Notice: Trying to get property of non-object in /var/www/vhosts/mysite.com/httpdocs/auth/googleoauth2/auth.php on line 326 Notice: Undefined property: stdClass::$name in /var/www/vhosts/mysite.com/httpdocs/auth/googleoauth2/auth.php on line 327

    My LinkedIn First, Last, and email address were in the debug info.
    Any advice would be appreciated.

    Thanks,
    Darrel
  • Picture of Balakrishna Thumma
    Wed, Jan 8, 2014, 3:30 PM
    Hi I am installed auth googleoauth2 plugin, but facing the problem following error is:
    The authentication provider sent us a communication error. Please try to sign-in again.
  • Picture of Ken Task
    Sun, Jan 19, 2014, 11:48 PM
    Great plugin! Thanks. Works for individual G accounts, but will it work with schools that have 'gone Google' ... ie, have a Google domain for the school? Is there some admin setting where that could be added/changed in the Moodle Admin UI? Also, if one logs out of Moodle, does it also logout of Google?
    Again ... thanks for your work. 'spirit of sharing', Ken
  • Picture of Graham Bowman
    Mon, Jan 20, 2014, 2:57 AM
    @Ken Task, it works exactly the same for Google Apps for Education/Business accounts. We combined our system with Moodle's ability to restrict the email address to specified domains. One tip is to add hd=domain.com as a parameter in the google login URL. This saves typing in the whole email address when logging in. See an example at http://ssa-vle.org.uk
    The domain specific login page is due to be depreciated soon, I don't know if this method will be affected.
  • Picture of Ken Task
    Tue, Jan 21, 2014, 2:59 AM
    @Graham. Thanks. Pardon my denseness, but what file do I edit to add the hd=domain.com parameter to the google login URL? Thanks, in advance, Ken
  • Picture of Graham Bowman
    Wed, Jan 22, 2014, 7:45 AM
    In the instructions I think it says to edit /login/index.php
    There is now a theme which shows how to add the buttons to an existing login page. In that theme it would be /layout/login.php where you add had=domain.com
    Let me know if you get stuck.
  • Picture of Tadthai Praichan
    Sun, Feb 23, 2014, 6:44 PM
    I try Oauth2 with Moodle 2.6
    facebook login not work
    google+ is very well
    how can i solve facebook login ?
  • Picture of Chetan Sharma
    Tue, Feb 25, 2014, 11:23 PM
    Hi,
    The FB Connect is working fine. All i want now is how can the FB profile pic automatically becomes the user's profile pic in Moodle.
    Also, how can we know that how many users have logged into our moodle site with thier FB. Where can i find details about them???
  • Picture of Tadthai Praichan
    Wed, Feb 26, 2014, 6:33 AM
    Hi Chetan
    when I sign in with facebook and windows Live
    webpage back to Log in again ..I don't why ?
  • Picture of Tadthai Praichan
    Sun, Mar 2, 2014, 6:28 PM
    please visit and help for check www.nokschool.com
    when login with facebook and windows live can not access siad webpage i use moodle 2.6
    thanks in advance
  • Picture of Mahesh Patil
    Tue, Mar 11, 2014, 1:46 PM
    Hi..
    I installed this plugin moodle2.3.1+
    I got the following error ,after facebook login which redirect to my site."Error writing to database" ...
  • Picture of Mahesh Patil
    Tue, Mar 11, 2014, 1:47 PM
    Hi..
    I installed this plugin moodle2.3.1+
    I got the following error ,after facebook login which redirect to my site."Error writing to database" ...
  • Picture of Ken Task
    Fri, Apr 4, 2014, 3:43 AM
    @Graham Bowman - ok, am stuck adding the hd=domain.com parameter to the google login URL.
    Directions say to add a line to index_form.html but what I'm seeing doesn't look like a link that goes to Google. Thanks, in advance, for any assistance.
  • Picture of Graham Bowman
    Fri, Apr 4, 2014, 5:34 AM
    index_form.php is the code for the username/password for a standard moodle login. Follow the instructions to add a login with Google button. Then in auth/googleoauth2/lib.php find href="https://accounts.google.com/o/oauth2/auth?client_id= and add https://accounts.google.com/ServiceLogin?Email=domain.com&continue=
    between href= and https://

    If that doesn't make sense send me a PM. It's not as good as the hd= method but that doesn't work any more, this method will add the @domain.com to their Google login screen so they just add their username.
1 2 3 4 5 6
Please login to post comments