Oauth2 authentication plugin for Moodle (for Moodle 3.2 and earlier)

Authentication ::: auth_googleoauth2
Maintained by Sergio Rabellino
Part of set OAuth2.
Sign-in with an Oauth2 provider. The first time you sign-in, a new account is created.
Latest release:
716 sites
115 downloads
272 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:

Screenshots

Screenshot #0

Contributors

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

Comments RSS

Comments

  • Jérôme Mouneyrac
    Wed, 28 Jan 2015, 7:55 AM
    Hi Craig,
    I just checked https://developers.google.com/accounts/docs/OpenIDConnect it seems to be the same calls/code, I think it will work. They just added some openid parameters into the mix in this documentation. Note that months ago I already fixed the deprecated API in order to use Google+ API. Let me know if there is any issue, it's hard to always follow Google changes, they love changes smile
  • Craig Simmons
    Tue, 3 Feb 2015, 6:39 AM
    Thanks Jérôme! It has been a hot topic here. I'll keep monitoring the situation. We can't use Google + as we are a K-12 school and so some of our students are too young to be able to use it. sad
  • Federica Marra
    Sat, 7 Feb 2015, 12:10 AM
    Hi Jérôme, I'm new in Moodle and also I never registered myself somewhere with my social account! I was wondering what can happens when someone creates the account with his/her social network account. What will be the data stored in Moodle (username, mail, password)? And if the social account is deleted also the Moodle account will be gone? Thanks for your time.
  • Andy Scherer
    Mon, 9 Feb 2015, 1:44 AM
    Hi guys

    The issue "error/couldnotgetuseremail" is back on my page. I didn't any update and use the newest version of this oauth Plugin.
    I have activated the "Google+ API" on the Google Developer Console.

    Also, I changed the Api key and secret either created a new project on google site, nothing has helped.

    As someone an idea what it could be?

    Thanks in advance!
  • Just wondering . . .
    Fri, 13 Feb 2015, 1:58 AM
    Does this work with Moodle 2.8??

    -Derek
  • Pralad Dessai
    Wed, 8 Apr 2015, 6:22 PM
    Hello

    I have enabled google oauth in our moodle instance

    Actually I am using a a customised alternate login url to login to it.

    So could you please advice me on how to get the google oauth option in my customised alternate login url to login.
  • Ammar Elhassan ElMerhbi
    Mon, 20 Apr 2015, 5:22 PM
    Hi
    How is it possible to place the sign in button below the login not top of the page? Thanks..
  • Ammar Elhassan ElMerhbi
    Tue, 21 Apr 2015, 5:13 PM
    Andy, please check your user authentication method. Go to users and check each user setting. Is the authentication method oauth or something else?
  • Ammar Elhassan ElMerhbi
    Tue, 21 Apr 2015, 5:13 PM
    Andy, please check your user authentication method. Go to users and check each user setting. Is the authentication method oauth or something else?
  • Ammar Elhassan ElMerhbi
    Tue, 21 Apr 2015, 5:14 PM
    Andy, please check your user authentication method. Go to users and check each user setting. Is the authentication method oauth or something else?
  • Charlotte Nicolas
    Tue, 2 June 2015, 4:28 PM
    Hi Jerome,

    I wonder if you plan to add Twitter Authentication in your plugin roadmap.
    If this is not the case, can you just explain the reasons (technical issue, lake of time...) ?

    Thanks,
  • Jérôme Mouneyrac
    Tue, 2 June 2015, 4:45 PM
    Hi Charlotte,
    I am planning to do it but I don't think it will arrive before, at least, a month. I am working on this plugin only when I have some free time and the desire to work on it smile I am currently rewriting the plugin using the popular PHPLeague Oauth2 client library that supports many extra providers (dropbox, instagram, square...). You can have a pick to this new version in the dev branch on github. However as the PHPLeague lib is also an Oauth2 client library it doesn't support twitter. Twitter uses Oauth1 for the authentication process (from my knowledge).

    To support Twitter I was thinking using https://github.com/thephpleague/oauth1-client as library. You can follow https://github.com/mouneyrac/moodle-auth_googleoauth2/issues/54

    Cheers,
    Jerome
  • Pau Ferrer Ocaña
    Wed, 10 June 2015, 10:34 PM
    Hi!

    We have a problem translating the module for 2.8, in AMOS we cannot see versions greater than 2.5 so the new strings are not included.

    Thanks!

    Pau
  • Jonatan martinez
    Sat, 13 June 2015, 6:29 AM
    Hola amigos, tengo instalado este maravilloso plugin, pero tengo un solo inconveniente con el, el problema es que cuando inician sesión en moodle abre automaticamente la sesión de gmail y demas, pero al salir de moodle deja las cuentas de gmail abiertas, hay una solución a este problema o aun no. de antemano mil gracias por su ayuda.
  • Charlotte Nicolas
    Mon, 15 June 2015, 8:31 PM
    Hi,

    Thanks a lot for your quick response and the links.
    I am working on french traduction of your plugin and I have another question about exeption you use in your plugin.
    Why don't you use $module parameter when you throw moodle_exception ?
    For ex : throw new moodle_exception('couldnotgetuseremail');
    Instead of throw new moodle_exception('couldnotgetuseremail','auth_googleoauth2');
    Thus, the translation is not taken into account for following error codes : unknown_oauth2_provider, couldnotgetuseremail, facebook_failure, google_failure, linkedin_failure...
    Do you plan to add this kind of modifications to the next version ?

    Thanks,
Please login to post comments