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

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

Maintained by Sergio Rabellino
Sign-in with an Oauth2 provider. The first time you sign-in, a new account is created.
Price option: Free

Supports Moodle 2.1-3.2 See all versions
Latest release: 7 years ago
Installations: 416
Downloads (last 90 days): 43

Frankenstyle name: auth_googleoauth2
Authentication
OAuth2

Comments

Comments are no longer open for new posts. Existing comments remain available to read.

The bug has been fixed in the new 1.2 release.
Hi Johan, thanks for your report. Can you please write your issue on github: https://github.com/mouneyrac/auth_googleoauth2/issues/new (same way that I indicated in my previous comment).
Can you before to do that turn on debug mode to developer and check what error is produced. Indicate the error in the issue.
Thank you.
Glad to see that a new version has been released! Tested the last one with moodle 2.5, and got it working.
I uninstalled it when upgrading to moodle 2.5.2, and now today installed the new oauth2-release.
And then I run on a problem.
After copying the files to the moodle/auth-directory and visiting ...moodle/admin , it installed fine, but when I try to go to Admin block > Plugins > Authentication to enable the plugin and see its settings, all I get is a white screen.
This happens when trying to access the settings for the plugin both from:
.../moodle/admin/settings.php?section=manageauths
and
.../moodle/admin/auth_config.php?auth=googleoauth2
Any thoughts on why this might happen?
Hi Frankie,
I can't see any new issues on github (https://github.com/mouneyrac/auth_googleoauth2/issues?direction=desc&sort=created&state=open ). It's easier to talk on each separate issues than here. Don't hesitate to provide a detailed description of this issue. Please include: Full Steps that I (or someone else willing to fix the issue) should take to reproduce the problem, as well as information about What You Expected and What Actually Happens for you.
Thanks,
Jerome
Hi Jerome. I've posted 2 issues I am facing on my Site
(1) Can't delete Google authenticated usernames on my Moodle
(2) E-mail notifications come into my inbox with some cryptic code instead of decriptive code.
See:
https://github.com/mouneyrac/auth_googleoauth2/issues?direction=desc&sort=created&state=open
Thanks, Frankie Kam
Hi guys, good news, at HQ it's personal project week next week. I plan to work on my authentication and enrolment plugins. If you have any request about them I think it's the right moment to go on github and create issues/request (https://github.com/mouneyrac/auth_googleoauth2/issues?direction=desc&sort=created&state=open) For this oauth2 plugin I'll start by making the ugly front page code less ugly. The code will be generated by a single function so it's not as complex as now to add the code to your login page.
Thank you.
Hi Frankie, thanks for your reports. If you can create some issue on github so we can have some trace of it, it would be create: https://github.com/mouneyrac/auth_googleoauth2/issues?direction=desc&sort=created&state=open
I'd love to work more on my plugins but I have limited free time, so I work on the security/pull requests issue first.
Hi Jerome. I've set Gravatar on in my Moodle 2.5 site. I'm wondering why when I click on the FB link and login using mt FB username and password, the avatar does not change to my FB avatar? Could I trouble you to test the http://www.moodurian.com/cefl FB login link?
Jerome!
Yes, I saw your Moodle account on my site and II don't know whether to laugh or to cry!
I spent N hours trying to fix the problem which was never a problem. In fact it was working fine all along! I think I'm gonna cry first then laugh whole-heartedly!
What happened was that I had earlier created an account the normal Moodle way and I used my Google E-mail address.
So many months later (now) when I click on the Google OAuth icon link in my login.php file, the code throws me back to the login screen simple because a Moodle account ALREADY exists where the user's email value is the same as my Gmail address!! LOL!!!!
Of course I am very happy that your plugin works on my site. I mean, to be doubly sure, I deleted the 'offending' Moodle user account, and when I click the Google login icon, vioila! Your plugin creates the user account, as what it was programmed to do, with my Gmail account.
After that, logging into my site with the Gmail icon link works everytime.
Coming back to the part that confused me - can the code be modified so that if it detects a user account that has the same Gmail account, can the code throw a warning message. Something like, "A username with the same Gmail address as yours has been detected!" ? That would have saved me hours of frustration.
A finally relieved and a very happy
Frankie Kam
I just tested and merged all existing pull requests. Thanks to everybody who contributed. Note that the last update forbid user creation when the setting preventing user creation in Moodle is set to ON. In this case, if you want someone to connect with it's Google/Facebook/... account, you need to change his/her authentication method to googleoauth2 (of course this user need to have the same email address on his/her oauth2 provider and Moodle). Cheers.
Hi Frankie,
it seems that you have fixed it, I successfully registered with Google on your site. Cheers.
Hi Jerome. I am stuck. I've set all three authentication services (G, FB, Live.com) but when I click on the Google icon link to login, after a short pause I get thrown back to the Moodle login screen. I'm using M2.5. Demo site: http://www.moodurian.com/cefl
I integrated michael's fix for the security issue, I re-enable the plugin: https://github.com/mouneyrac/auth_googleoauth2/commit/f43c39ad33e5a4ffa1c46d264807962e786020ee#auth.php
Cheers for the reply Graham. I figured it out. I was trying to login with GoogleOAuth2 using an account that was already set up in LDAP with the Gmail email address. Changing the authentication method in the user settings in Moodle to GoogleOAuth2 fixed my problem.
However, I have come across another issue. The City & Country fields aren't being automatically populated when creating a new user using GoogleOAuth2.0. I have the location settings set up in Moodle and they are pre-filled when adding a new user manually in Moodle, but they remain blank when loggin in with OAuth for the first time. I have the City & Country fileds unlocked in the OAuth plugin settings, however the same problem occurs when they are locked.
Any ideas?
@William, I made a copy of the usual login page (and html form) and renamed it. Then edited the index page with the google auth as per the instructions. This makes google apps the default login but you can still access the username/pw if necessary.
If that doesn't work, check your redirect URL in you google console?