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

  • Carlos Rozas
    Tue, 27 Sept 2011, 12:16 AM
    Dear Jerome, I try to implement your pluggin in my website running moodle 2.1, follow your instructions, but I got stuck in step 4, I don't know how to include a logging block in a Moodle 2.1 theme, can you place more specific instructions about this issue, please?
  • Jérôme Mouneyrac
    Sun, 30 Oct 2011, 3:04 PM
    Hi Carlos.
    if you implement the 'provider logos example code' at the same place as I did (in my theme as mentioned in step 4), then you need to read these documents: http://docs.moodle.org/dev/Themes_2.0 and http://docs.moodle.org/dev/Themes_2.0_creating_your_first_theme

    Tips: look in your theme/config.php. You should find a "login" section in $THEME->layouts. There is indicated the login layout file name where you should put the example code. Sometimes it's a login.php layout file, sometimes it's another layout file. It depends of your theme.

    At the end, the step 4. is just about displaying a link to a provider to start the authentication process.
  • Beto Castillo Llaque
    Sat, 19 Nov 2011, 7:38 PM
    hello, I have Moodle 2.1.2, in the step 2 the Manage authentication get in blank page
  • Musica
    Sat, 26 Nov 2011, 10:06 AM
    Hi! i can't do this work!
    Can you tell me where i will paste this html code?, be cause i has been pasted in theme/nameofmytheme/layaout/general.php. I was pasted in the head and in the line 135 in the body and it doesn't work.
    would you help me please!
  • Jong-Dae Park
    Sat, 26 Nov 2011, 2:21 PM
    You can save the html code into a file, for example login.php. Then include the file in general.php, just before the footer part. <?php include("login.php"); ?>
  • Jong-Dae Park
    Sat, 26 Nov 2011, 8:52 PM
    isset() functions needs to be replaced by !empty() in facebook_redirect.php,google_redirect.php, and messenger_redirect.php.
  • Manish Verma
    Fri, 9 Dec 2011, 1:40 PM
    I find that Name, Email, City, Country etc. fields are blank in the moodle profile of the user. What could be the issue and how to fix this.
  • Jérôme Mouneyrac
    Mon, 12 Dec 2011, 2:15 PM
    Hi guys, Manish alerted me about Jong-Dae comment. I pushed a fix on github. Use github issue tracker when you have an issue, I receive alert emails from github. Otherwise for Manish blank fields issue I'm aware of it but I don't know yet what is the cause... Follow it on github: https://github.com/mouneyrac/auth_googleoauth2/issues/8

    Cheers.
  • Robert Bailey
    Fri, 30 Dec 2011, 5:45 AM
    Jerome,

    Awesome plugin! The company I work for, TutoringZone, has been using it to great success! We were hoping that there is a method by which a user's Facebook profile picture could be set to their Moodle profile picture as well. Have you worked on this implementation at all? I'd be interested to see how this functionality would work...

    Thanks!
    Rob Bailey
    Technical Director, Tutoringzone
  • marina shorer
    Thu, 5 Jan 2012, 2:14 PM
    Dear Jerome, I use Standard theme for Moodle 2.0. In the theme config.php file there in no $Theme->layouts. There are variables for 'blocks', 'user', 'calendar', 'css3' etc. But no 'login' or 'layout'. It would be great to know where can I put the code from the README file? Thanks! Marina
  • Jérôme Mouneyrac
    Fri, 6 Jan 2012, 5:30 PM
    Hi Robert, it's a good idea and I guess it should not be too hard to implement if Facebook give you the profil picture.

    Marina , as example, in my project:
    I created a file theme/MYTHEME/layout/login.php
    in this file I duplicated my main layout (it was call general.php) and I added the code.
    in theme/config.php I added:

    $THEME->layouts = array(
    ...
    'login' => array(
    'file' => 'login.php',
    'regions' => array(),
    'options' => array('langmenu'=>true),
    ),
    ...
  • Mircea Adrian FOCȘA
    Thu, 26 Jan 2012, 7:55 PM
    Apparently the installation gone well but after login I was redirected to a personal profile with name and city to be completed. I couldn't save the profile because no emai address displayed and no input field for this.
    In this point I am stuck because I couldn't find anything on the net to solve this.
    I also want to mention that Google logo dose not apear properly. The site is: http://dim.umft.ro
Please login to post comments