Maintained by Picture of Sergio RabellinoSergio Rabellino
Sign-in with an Oauth2 provider. The first time you sign-in, a new account is created.
1185 sites
457 downloads
269 fans
Current versions available: 3

Plugin end of life starting from Moodle 3.3

starting from Moodle 3.3, Oauth2 should be implemented in Moodle core. It will require you to upgrade to Moodle 3.3 and switch to the Oauth2 core authentication (and probably do some migration), but it is a great news as authentication is a really sensible matter and having Oauth2 plugins in core will guarantee their maintenance. So starting from Moodle 3.3 I highly recommend to use the new Oauth2 core plugins ((https://docs.moodle.org/dev/Better_Office_Integrations_3.3#Core_API_for_managing_Authorized_OAuth_Applications) ) . Missing core providers will likely be implemented by someone and published in the Moodle.org plugin repository. There will probably be a new Oauth2 category in the Moodle plugin repository. Wait and see...

I will try to mantain this plugin until Moodle 3.1 (LTS) runs out of security upport  (13 May 2019).


Warning for Facebook users 

The plugin stopped working the 27th March 2017 as Facebook closed the API 2.2. The last versions of this plugin have been updated to support Facebook 2.8 API. As usual carefully test before upgrading a third party plugin if your Moodle site is important to you (especially as it is an authentication plugin)


Installation

  1. add the plugin into /auth/googleoauth2/
  2. in the Moodle administration, enable the plugin (Admin block > Plugins > Authentication)
  3. in the plugin admin page, follow the displayed instructions.

I also created a free mini-course on how to install a Moodle plugin using Oauth2 plugin as example.


Documentation and support

You can search in all existing issues on Github. Go to the issues page, next to the filter button there is a search field. Remove the default content, type your keywords and press enter.

There is a FAQ too.

Alternative plugins

There are many alternatives to this plugin, if you have any trouble with this plugin it may be a good idea to try them:

Sets

This plugin is part of set OAuth2.

Screenshots

Screenshot #0

Contributors

Picture of Sergio Rabellino
Sergio Rabellino (Lead maintainer)
Picture of Jérôme Mouneyrac
Jérôme Mouneyrac: Original author and previous maintainer
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Picture of Craig Hamer
    Wed, Mar 22, 2017, 5:53 PM
    I am attempting to isolate users of Oauth2 that are using facebook authentification. Is there a way to find just these users?
  • Picture of Jérôme Mouneyrac
    Wed, Mar 22, 2017, 6:01 PM
    Hi Craig, yes you should be able to find this information in the plugin database table (look in db/install.xml to see the structure)
  • Picture of Craig Hamer
    Wed, Mar 22, 2017, 8:05 PM
    Would this be on the server? I am not an admin, and we are without an admin at the moment. How can I find this file?
  • Picture of Jérôme Mouneyrac
    Thu, Mar 23, 2017, 8:58 AM
    Hi Craig, unfortunately only someone with a minimum of administration experience can access the information about who use what. Maybe your administrator installed something like phpmyadmin which allows you to access the database table from a web interface (but if you don't not what you are doing you probably want to stay away from touching the DB). In any case you want to have a look at the tables mentioned in https://github.com/mouneyrac/moodle-auth_googleoauth2/blob/master/db/install.xml

  • Picture of Jérôme Mouneyrac
    Thu, Mar 23, 2017, 9:08 AM
    in my last comment " In any case" should be read "would you go this way".
  • Picture of Craig Hamer
    Thu, Mar 23, 2017, 4:09 PM
    Are you available to work on this if I give you access and what would that cost? craig@growdly.com is my email.
  • Picture of Jérôme Mouneyrac
    Sat, Mar 25, 2017, 10:29 AM
    Hi guys

    I did try to fix the Facebook issue again, trying to upgrade the phpleague lib to a more recent version (without even trying the last phpleague 2.X version, just the last 1.X version so refactoring would be minimum) but it would still mean rechecking all providers and likely doing some refactoring. I don't have the time for that right now, sorry sad

    However I created a quick script to know who is using Facebook and so you can alert your users. You need to put the code in a .php file in your Moodle root folder and access it from your browser (of course delete the file once you ran it and so know who is using facebook to login).

    require_once('config.php');
    $facebook_users = array();
    $facebook_logins = $DB->get_records('auth_googleoauth2_logins', array('subtype' => 'facebook'));
    foreach($facebook_logins as $facebook_login) {
    if (empty($facebook_users[$facebook_login->userid])) {
    $facebook_users[$facebook_login->userid] =
    $DB->get_record('user', array('id' => $facebook_login->userid), 'id, username, email, firstname, lastname, lastlogin');
    $facebook_users[$facebook_login->userid]->lastlogindate = date('Y-m-d H:i:s', $facebook_users[$facebook_login->userid]->lastlogin);
    }

    }
    echo count($facebook_users) . " googleoauth2 facebook user(s)";
    echo "
    ";
    print_r($facebook_users);
    echo "
    ";
  • Picture of Jérôme Mouneyrac
    Sat, Mar 25, 2017, 10:31 AM
    the above script works but inside the echo " "; was meant to be echo " < pre >"; and echo " < /pre > " without the whitespace in the " "
  • Picture of Alosies George
    Wed, Mar 29, 2017, 12:14 PM
    Is there any way I can continue to use this awesome plugin for Facebook Login? As given in the description I understand that Facebook has deprecated Graph API 2.2 by March 27th. Our website has a Facebook-login-only system and users have not been able to login. No other plugin on plugin directory is helping to achieve the cause. It would be great if someone can point in the right direction.
  • Picture of Jérôme Mouneyrac
    Wed, Mar 29, 2017, 7:05 PM
    Hi guys, I just added a new version with the fix for Facebook authentication provided by Damyon Wiese. Hopefully we wil have 2.6 and 2.5 soon, keep up to date on the tracker issue: https://github.com/mouneyrac/moodle-auth_googleoauth2/issues/231
  • Picture of Jérôme Mouneyrac
    Wed, Mar 29, 2017, 9:05 PM
    I pushed a new version for 2.5 and 2.6 to fix the Facebook login (thanks to Sergio and Damyon, see https://github.com/mouneyrac/moodle-auth_googleoauth2/issues/231). I tested on my local machine but I didn't have an already set 2.5 and 2.6 site with the old Facebook API, so even thought I think it works, carefully test before upgrading your prod. (anyway I think all these versions are not supported anymore by HQ so you should really upgrade your Moodle site!)
  • Picture of Phuong Hoang
    Thu, Apr 6, 2017, 5:03 PM
    Hi guys,
    Help me!
    Most of my users log in my site via facebook and gmail. Unfortunately, neither of them works when I upgrade this plugin to Release 2.3 (Build: 2016061204). I know "The plugin stopped working the 27th March 2017 as Facebook closed the API 2.2. The last versions of this plugin have been updated to support Facebook 2.8 API". My App's API version 2.3, when I upgrade API, it says; Your app hasn't made enough calls to the Graph API to show any info, or there are no changes for the methods you selected between v2.3 and v2.8.
    Now my site is using release 2.3 (Build: 2016061202) and only gmail works.
    Any suggestions are apprecited.
    I'm using moodle 3.2.2
  • Picture of Phuong Hoang
    Thu, Apr 6, 2017, 9:45 PM
    The lastest release is NOT Release 2.3 (Build: 2016061204), plz check!
  • Picture of David Mudrák
    Thu, Apr 6, 2017, 10:17 PM

    I am happy to announce that this plugin has been adopted! The new maintainer is Sergio Rabellino, the head of the ICT services of the University of Turin. Good luck and thanks for keeping this plugin supported!

  • Picture of Jérôme Mouneyrac
    Thu, Apr 6, 2017, 10:22 PM
    Hi guys

    Due to lack of time, I hand over the plugin maintenance to Sergio Rabellino. Sergio is a well known Moodler and he will be more than qualified to maintain the plugin.

    Sergio accepted to maintain the plugin until the Oauth2 core plugin stabilises. So you should have time to move over to the Oauth2 core plugin introduced in Moodle 3.3 - we expect you to have moved to it by mid 2019.

    We transfered the official repository from my Github account to his Github account there: https://github.com/rabser/moodle-auth_googleoauth2. So if you are using Github, there will be no impact for you as Github should automatically redirect the previous git repository url to the new one.

    I would like to thank Sergio to take over, I really appreciate it, and I wish you all the best in your new adventure as maintainer.

    I also thank Moodle HQ that allowed me to work on the plugin during a project week, Guillermo from rewrite.com.ar (the unique donator in 5 years), the Moodle Partner Elearning Experts LLC. to have contracted me to update the code to support a Google API change, and also all the contributors.

    Kind Regards to everyone,

    Jerome Mouneyrac
Please login to post comments