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
121 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

  • Graham Bowman
    Tue, 10 June 2014, 2:15 AM
    Parupkar Singh, have you enabled API access in your Google Apps admin settings? There should be instructions on the plugin settings page. You need to go to https://code.google.com/apis/console
    Google console API > API Access > Create another client ID...
    Then set the "Redirect URLs" and "Javascript origins" to what the settings page shows you (it will be unique to your site).

    We have been using this with 2.7 and it's not had any issues.
  • Parupkar Singh
    Tue, 10 June 2014, 2:30 AM
    Thanks Graham Bowman, i have already done all of that you said. But its making error like "You do not have permission to use the site yet. Please contact your administrator and ask them to activate your account." you can also check on http://www.vle.neoteachers.com/login/index.php
  • Parupkar Singh
    Tue, 10 June 2014, 1:45 PM
    Still its not working please help...!!! same error is going on
  • Davíð Baldursson
    Tue, 10 June 2014, 7:24 PM
    I am trying to get this to work as a block which I can put on the front page. Is that possible or do I need to do some extensive programming myself to get it to work?
  • Anwar Deen
    Mon, 23 June 2014, 9:55 PM
    Hi ,

    I am new to Moodle. I want to integrate facebook connect with oauth. for this I have added the Facebook APP id and secret key. In front end it's showing the Facebook connect button and i have clicked on that and going to facebook and ask me to okay the app. then it return the below error.

    "The authentication provider sent us a communication error. Please try to sign-in again."

    Please help me to resolve this issue.

    Thanks in advance.
    Anwardeen
  • Jamie Kramer
    Fri, 27 June 2014, 10:02 AM
    Is this plugin affected by any Google deprecations?

    I submitted this as an issue in Github, but didn't know if it was more appropriate to ask here instead. I apologize for cross posting, I just wasn't sure which place was better.

    https://github.com/mouneyrac/moodle-auth_googleoauth2/issues/63
    It is not immediately obvious to me if this plugin is affected by anything that Google is deprecating. It appears to me that this plugin is not affected by anything on that web site but just wanted to be reasonably sure. Google migration timetable is located at: https://developers.google.com/+/api/auth-migration#timetable

    Thank you.
  • Guillermo Domínguez Aguilar
    Tue, 5 Aug 2014, 11:28 PM
    This is an amazing plugin, and a bit confusing too. After 2 weeks working to activate it and a lot of tests I figure it that have one condition that needs to be addressed.
    The login process is OK, but if you have accounts that have registered the same email address inside the google or facebook account, the process brake without notifications and shows the native moodle login process. I realized that after a bunch of documents readed over internet about oauth2 process.
    My recomendations to the maintainers is to add the code to advertice this condition, and to the rest of us to check the pressence of this condition and to support the users in this and to take correct decisions about wich kind of account will support.
    Thanks in advance.
    Guido.
  • kio cha
    Sat, 9 Aug 2014, 4:55 AM
    Hi have the problem that when i try to login i get this error "error/couldnotgetuseremail". Anyidea?
  • Pau Ferrer Ocaña
    Mon, 1 Sept 2014, 7:20 PM
    We suggest to change the fixed strings like Sign-in with Google in lib.php by a get_string like that:
    get_string('signin_google','local_agora', 'Google'). The login buttons are the main login interface and cannot be translated!

    Thanks for this great module smile
  • Francis Vendrell
    Thu, 11 Sept 2014, 12:08 AM
    If I have well understood, either the user get always connected through Facebook (for example), either the usual direct way.
    The user cannot login sometimes through Facebook and sometimes in the direct way.
    The way the user can login is determined by the way its account has been created, once for all (unless the admin modifies it).
    Is that correct?
  • Lu Pa
    Fri, 19 Sept 2014, 8:48 AM
    Hello all, we are trying to modify this module to use it with Wordpress (through https://github.com/justingreerbbi/wordpress-oauth) but we get this error:

    Debug info:
    Error code: couldnotgetgoogleaccesstoken

    Stack trace:
    line 425 of /auth/googleoauth2/auth.php: moodle_exception thrown
    line 89 of /login/index.php: call to auth_plugin_googleoauth2->loginpage_hook()

    Output buffer:
    Notice: Trying to get property of non-object in /var/www/moodlepru/auth/googleoauth2/auth.php on line 189

    any idea what could be the error? or how debug it ?
  • Lu Pa
    Fri, 19 Sept 2014, 8:54 AM
    Be careful ! I realized that this module version (download section) is not the same of here: http://mouneyrac.github.io/moodle-auth_googleoauth2/ (that is latest)
  • Vincent MARECHAL
    Mon, 22 Sept 2014, 8:12 PM
    Hello Jérôme Mouneyrac,

    It installed in few minutes and works fine with Google.
    But I need two things :
    * I need the created username with Google to be equal to the email address (and not social_user_),
    * I really need to lock new account creation with Google to be locked to a Google Apps domain, i.e. I don't want any user to be able to create an account, but just visitors that have email address from @mygoogleappsdomain.com.

    Is it possible to reach these two needs ?

    Thanks again for this great plugin.
    I'm using for the moment an OpenID plugin, but OpenID is depredated, then I need to go to Oauth2

    Kind regards,

    Vincent MARECHAL
  • Vincent MARECHAL
    Mon, 22 Sept 2014, 8:19 PM
    Mea culpa, it's ok to restrict to my domain, it's in the moodle auth page.
    But I still need creaed username to be equal to the email address.
    Thanks
  • Raül S.
    Thu, 25 Sept 2014, 9:26 PM
    Hi Jérôme,

    like Kio Cha, I have the same problem, I'm using moodle 2.4, whe I try to login i get this error "error/couldnotgetuseremail". Anyidea please?
Please login to post comments