oauth2client.client.HttpAccessTokenRefreshError: invalid_grant: Bad Request #451
Comments
Check that your system clock is accurate |
This is pretty interesting - we just ran into what appears to be the same issue on an app engine application with user credentials. |
It looks okay
|
Why don't you try to force a clock update with |
My error is intermittent, and on appengine, so not sure that it is clock related. |
Thx, dhermes. Amazing support!. It is true, my problem is related to the |
Turns out I'm not a wizard magician, just seen it before (#193). @jonparrott maybe GAE is having clock issues? |
¯_(ツ)_/¯ I don't think the clock issue would affect user credentials refresh requests, plus we may have found (part) of the bug in #452. |
Ahh good call. Though I can't verify that the payload doesn't have a timestamp in it. |
hello. thanks for the information!! I have already checked my server time and looks fine.. However, I'm still getting HttpAccessTokenRefreshError. I'm doing server-side operations. The user token is expired, but fails at refresh. The cliend_id and client_secret are taken from my OAuth2 google console account. What more information could I provide to you?
|
Ok. After a loong research I guess I found out the problem. In fact, refresh_token was missing from the user credential, but the issue was tricky. The refresh token is given for the FIRST time when the application asks the user for permissions. The refresh token is given ONLY IF the flow's step 1 includes the parameters For some reason the user (me) hadn't got refresh_token in user's credentials, so I revoked permissions from the application on My Account -> Security -> Applications, and restarted the OAuth dance again. Now I got refresh_token. However, here guys says we would need to send |
Thanks @redraw ! |
@redraw we just hit the same issue, and I thought |
That's right, I only kept prompt=consent and did the job. Here's some doc but it is never clear! |
It looks like something on my machine and I have no clue where to go from this point. So, the problem is that two(or 3) weeks ago the bigquery started to reject my calls with invalid token response. I've deleted my account, created a new support one and updated to a new oauth2client version. The result is the same.
(!): at localhost it works without problem!
Version: 2.0.1
Tried with p12 and json
Wow effect (the second picture is created after 3 seconds, the same request/body/headers):
Console:
The text was updated successfully, but these errors were encountered: