Moodle plugins directory: Oauth2 authentication plugin for Moodle (for Moodle 3.2 and earlier) | Moodle.org
Oauth2 authentication plugin for Moodle (for Moodle 3.2 and earlier)
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
- add the plugin into /auth/googleoauth2/
- in the Moodle administration, enable the plugin (Admin block > Plugins > Authentication)
- 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:
- Moodle core Oauth2 plugins (Moodle 3.3 and later)
- Elcentra
- LenAuth
- OpenID Connect
- LinkedinAuth
- check the auth plugin list
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.
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
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.
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.
get_string('signin_google','local_agora', 'Google'). The login buttons are the main login interface and cannot be translated!
Thanks for this great module
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?
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 ?
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
But I still need creaed username to be equal to the email address.
Thanks
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?