Google oAuth Upgrade token error

Google oAuth Upgrade token error

by Kirsty Robinson -
Number of replies: 2

Hi, 

So I'm a noob and I apologize if I have over looked something but I'm tearing my hair out trying to get this to work.

So what we want to do is have people use their google accounts to login to our moodle portal to access our courses.

what is currently happening:

  1. Sign in button shows
  2. goes to the authorization screen
  3. then after signing up it gives us the error: error/Could not upgrade oauth token

What we have set up:

  • Moodle installed in a EC2 AWS instance
  • Google credentials created
  • Credential screen verified and approved by google
  • google credentials set in our moodle instance

Can anybody help me in resolving this error message I can't find any helpful information on this error

eventually when everything is running we will be masking the ec2 url with one from our main website

Attachment google auth key.PNG
Attachment moodle error.PNG
Average of ratings: -
In reply to Kirsty Robinson

Re: Google oAuth Upgrade token error

by Ken Task -
Picture of Particularly helpful Moodlers

In moodle config look for “Authenticate token requests via HTTP headers” ... is it checked or unchecked?

Under the setup of the oauth 2 where you have shown the key/secret just below that ...  Authenticate token requests via HTTP headers

Had the same thing happen one time and checking/unchecking that setting fixed it.

On a side note, in going to a server today set up for Google Oauth2 to find that info, got this:

cURL request for "https://lh3.googleusercontent.com/a-/AAuE7mBslslssoherlongline" failed with: Operation timed out after 10000 milliseconds with 179466 out of 480423 bytes received (28)

    line 1568 of /lib/filelib.php: call to debugging()
    line 337 of /lib/classes/oauth2/client.php: call to download_file_content()
    line 412 of /auth/oauth2/classes/auth.php: call to core\oauth2\client->get_userinfo()
    line 49 of /auth/oauth2/login.php: call to auth_oauth2\auth->complete_login()

First time ever seeing that!!! While error displayed, clicking continue did authenticate and was logged on.

This to say, Google not infoulable ... could have a hickup ... and of course network connectivity involved ... network comes before application.  Could have been my connection to internet at the time.

'SoS', Ken

In reply to Ken Task

Re: Google oAuth Upgrade token error

by Kirsty Robinson -
I've tried with both checked and unchecked. when I check it and save a new error pops up saying:
error/Could not discover service endpoints: Could not resolve host: accounts.google.com

the settings take and I can still work