Google authentication setup on Moodle 3.3

Re: Google authentication setup on Moodle 3.3

by Yogesh Nahar -
Number of replies: 1

Thank you to the community for helping resolve this issue. 

But I came across another issue when testing with multiple Google accounts in the Chrome browser.

So here is the scenario:

I have allowed Moodle to create new accounts on authentication. The setting Prevent account creation on authentication under 'Authentication' is off.

Next I click on Login via Google, and am taken to the Google accounts login page. Here I have multiple accounts in the Chrome browser but all the accounts are signed out. See screenshot 1. So if I click on any email address and login, it authenticates and goes to a email sent for confirmation screen in Moodle. This is fine. 

But going through the same steps above with multiple Google accounts already signed in is creating an issue. So if I am taken to the Google accounts login page and I have say 2 Google accounts logged in already and if I select from any of those accounts (that does not exist in Moodle) to log me in to Moodle, it simply starts redirecting but then refreshes and comes back to the same Google login page. 

Here are the URLs:

When I reach the Google SSO login page: 
https://accounts.google.com/signin/oauth/oauthchooseaccount?client_id=448236099137-1t7nfe1v3o189octrkl1em8c4icck3ls.apps.googleusercontent.com&as=-43077ec6f2bd02bf&destination=http%3A%2F%2Facademy.carterradley.com&approval_state=!ChRTRzZfWV9qa3loZnJyZXZSZVNMXxIfZzRYQjY0Unh6RmdYVU9xWmlfQjdtUjlrbkxxQnpoVQ%E2%88%99ADiIGyEAAAAAWVNEGjZa0Qzyp9i_vAhfevVFk8BdSeFb&xsrfsig=AHgIfE8patmsAycjpw9vJoTRg1iexmh4Aw&flowName=GeneralOAuthFlow

When it starts redirecting after I click on a Google account to sign me in it shows a new URL but then refreshes and goes back to the one above: 

https://accounts.google.com/signin/oauth/oauthchooseaccount?client_id=448236099137-1t7nfe1v3o189octrkl1em8c4icck3ls.apps.googleusercontent.com&as=-43077ec6f2bd02bf&destination=http%3A%2F%2Facademy.carterradley.com&approval_state=!ChRTRzZfWV9qa3loZnJyZXZSZVNMXxIfZzRYQjY0Unh6RmdYVU9xWmlfQjdtUjlrbkxxQnpoVQ%E2%88%99ADiIGyEAAAAAWVNEGjZa0Qzyp9i_vAhfevVFk8BdSeFb&xsrfsig=AHgIfE8patmsAycjpw9vJoTRg1iexmh4Aw&flowName=GeneralOAuthFlow

Any one come across a similar issue? Tried searching the forums but cannot find this reported. Any ideas why this might be happening? 

I have tested this in multiple browsers. Same issue. Any advice on debugging? 

Thank you for your time. 

In reply to Yogesh Nahar

Re: Google authentication setup on Moodle 3.3

by Marcos Rugerio Islas -

Hi Yogesh Nahar

Did you fixed you issue? I have a similar problem in this week and I all ready fixed, in my case I needed to enable the OAuth service and check the ecact location of the oauth2callback file on my system, according the documentation and installation you can find on your server over the following path where the moodle platform was installed.

In my case moodle is installed on / path
marcos@desarrollo:/moodle33/admin$ ls |grep *oauth*
oauth2callback.php


Othe issue was the name... I was typing wrong the name tongueout

Right now is working with Google and Facebook, I am working to enable Github.