Oauth 3.2 Help!

Oauth 3.2 Help!

by Gerardo Demera -
Number of replies: 3

Hello,

Im trying to setup the google Authentication in my moodle site, i did all the step create my project in google console, create the credentials for the client id and secret id and enable the Google+ API but when i trying to log in via google give me an error: The OAuth client was not found. 

Capture form the error:Error

Average of ratings: -
In reply to Gerardo Demera

Re: Oauth 3.2 Help!

by Ken Task -
Picture of Particularly helpful Moodlers

First, suggest moderators might consider the op has shared too much info.

But, without that info, may have never had a specific suggestion as to how to fix and what to check.

You are using a plugin for Google Oauth2 that is NOT part of core but an addon (the built in not present in version 3.2).    That plugin did show the call back url you have to enter in the Google end setup.  Make sure that callback url is correct on the Google end.

Note the lines above that show values for variables ... see the client id= has a 'space' before the ID number.

So in your Moodle config, check the setup of both the key and the secret.   Hard to see but there could be a space at the beginning of both the secret and the key ... as well as a space at the end of each of those.

Remove the spaces at beginning and at end of both secret and key then save.   Then logout and TIA (try it again).

Also, your server is behind 'CloudFlare'.   Is there any setting you might need to change in your setup of CloudFlare?    Can't help ya with that one.

'spirit of sharing', Ken


In reply to Ken Task

Re: Oauth 3.2 Help!

by Gerardo Demera -

Thx,

I removed the blank spaces and problem resolved.

In reply to Gerardo Demera

Re: Oauth 3.2 Help!

by Ken Task -
Picture of Particularly helpful Moodlers

Great!   Good to hear it.   Consider marking the response that helped as 'useful' ... helps me 'earn' my badges! ;)

Also ... be forewarned ... when you upgrade to 3.3/3.4 there will be issues with the 3rd party plugin you are using and the core code which includes config of Oauth2 services ... Google is one.

Advise getting a look at your mdl_user table now to see how users that authenticate with your addon now.  That info will be useful when planning/doing a conversion of authentication of existing users in your system such that those users do NOT need to be removed nor do those users need to create a new account ... ie, their row in mdl_user keeps the same ID number (which means any work submitted, quiz taken, certs acquired, etc.) won't be orphaned or lost.

'spirit of sharing', Ken