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
459 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 Jérôme Mouneyrac
    Fri, Nov 6, 2015, 1:19 PM
    Marlon: usually it is because people enter the wrong key/secret.
  • Campamento de robotica educativa
    Sat, Nov 7, 2015, 12:08 AM
    Jérôme Mouneyrac resolví el problema, es que en el servidor necesitaba instalar unos módulos de php pecl, oauth, y luego añadir la en /etc/php.ini extension=oauth.so smile
    Pero ahora tengo otro problema, estoy probando aunteitcarme con facebook, y me da el problema siguiente

    Tu dirección de correo electrónico no ha sido verificado por el método de autentificación que has seleccionado. Puede ser que te hayas olvidado de hacer click en el enlace "verificar dirección de correo" que Google o Facebook debía haberte mandado durante la subscripción a su servicio.
    Debug info:
    Error code: emailaddressmustbeverified

    ahora si ya no se qu ehacer
    NOTA: la auntenticacion con google funciona perfecto
  • Campamento de robotica educativa
    Sat, Nov 7, 2015, 12:10 AM
    Hola nuevamente,tengo este error
    Tu dirección de correo electrónico no ha sido verificado por el método de autentificación que has seleccionado. Puede ser que te hayas olvidado de hacer click en el enlace "verificar dirección de correo" que Google o Facebook debía haberte mandado durante la subscripción a su servicio.

    Más información sobre este error, es cuando quiero auntenticarme con facebook, pero con google funciona perfect
    Debug info:
    Error code: emailaddressmustbeverified
    Stack trace:

    line 258 of /auth/googleoauth2/auth.php: moodle_exception thrown
    line 89 of /login/index.php: call to auth_plugin_googleoauth2->loginpage_hook()
  • Picture of Denis Belaev
    Sat, Nov 7, 2015, 8:10 PM
    Hello, thank you for good plugin! Is it possible to show plugin block not only on login page login/index.php, but on all pages of the web site? If yes, where in the code should I switch it on? Thank you very much!
  • Picture of Phuong Hoang
    Tue, Nov 10, 2015, 12:26 AM
    Hi Jérôme,
    I installed your plugin and it works like a charm. However, I wonder why my login buttons; Google and facebook... don't look like your demo. I missed something? How can I get like yours? Many thanks in advance.
  • Picture of Jérôme Mouneyrac
    Tue, Nov 10, 2015, 12:09 PM
    Phuong: did you download the 2.2 version (for Moodle 2.7 and higher)? Only this version has the new design/improvements. I do not backport anymore changes to 2.6 as it is not maintained anymore by Moodle HQ.
  • Picture of Jérôme Mouneyrac
    Tue, Nov 10, 2015, 12:12 PM
    Denis: you need to create a simple block and insert the php code mentioned in the setting page. Note that you don't want to display this block on the login page if the login page already contain the oauth2 buttons. At the current state the plugin doesn't support to have twice the Google/Facebook... oauth2 buttons. Only the last instances of the oauth2 buttons will work (it is unlikely you do that but I just mention it so you are aware).
  • Picture of Phuong Hoang
    Tue, Nov 10, 2015, 11:28 PM
    Jérôme: I'm using version 2.1 (for Moodle 2.7 and higher), I'll update. Thanks
  • Picture of Daniel Tillman
    Fri, Nov 13, 2015, 10:57 AM
    I love this plugin and it generally works well. However, my students, all using Safari on iPads get the following error on occasion and I have no clue why. "exception - Error fetching Oauth2 access token, message: "invalid_client"

    Can you shed a little light onto this for me?

    I am using Moodle 2.9.2+ and the newest version of the plugin Release 2.2 (Build: 2015110600)
  • Picture of Jérôme Mouneyrac
    Tue, Nov 17, 2015, 5:03 PM
    Daniel: this is interesting, I was not aware of it not working on iPad. Can you write on issue on github. Could you put a video of it too. I'll test it on my old broken ipad2 smile thanks.
  • Picture of Daniel Tillman
    Thu, Nov 19, 2015, 10:39 PM
    I am trying to get a screenshot of this error, but cannot reproduce it, it is an occasional error, but crippling if the teacher wants to give a quiz in moodle and 1 or 2 students can't log in. It could be something on Google's end, or an issue with the server itself rather than an error with the plugin.

    The plugin generally works just fine on iPads as well as on the Mac's we have here at school. Sometimes the error pops up at the initial login to the site, sometimes it pops up when trying to get access to their google drive to upload a file to moodle. I have seen it on several students' ipads, but it appears totally at random. We have 1200+ iPads on campus and have personally only seen it only a few times but I have heard from teachers about it happening a few other times.
  • Picture of Daniel Tillman
    Thu, Nov 19, 2015, 11:25 PM
    I finally got a screenshot of the error from a student. I have posted it to GitHub.
  • Campamento de robotica educativa
    Sat, Nov 21, 2015, 3:14 AM
    Estoy tratando de hacer un link (button) con otra web para login con google a mis course de moodle, pero me dà este error
    Error code: Invalid state parameter
  • Campamento de robotica educativa
    Sat, Nov 21, 2015, 3:16 AM
    Como puedo obtener ese 'state' parameter..trato de hacerlo con esto,
    pero no consigo <?php
    require('../config.php');

    global $USER, $SESSION;

    $SESSION->sesskey = $USER->sesskey;
    ?><?php echo sha1($USER->sesskey);?>
  • Picture of Scott Adamson
    Tue, Nov 24, 2015, 12:10 AM
    Using this tool, can we limit the account creation to JUST a login from our Google Apps accounts (limit and not open to the public).
    Thank you
    Scott
Please login to post comments