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 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:
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.