Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

OAuth Client ID Token has been Expired or Revoked

Hello,

We created an OAuth 2.0 Client ID on November 3 for a Desktop App. It worked fine for a day and ever since we have been getting the following error while using the app,

 

ERROR:root:('invalid_grant: Token has been expired or revoked.', {'error': 'invalid_grant', 'error_description': 'Token has been expired or revoked.'})
WARNING:google.auth.compute_engine._metadata:Compute Engine Metadata server unavailable on attempt 1 of 3. Reason: timed out
WARNING:google.auth.compute_engine._metadata:Compute Engine Metadata server unavailable on attempt 2 of 3. Reason: [Errno 113] No route to host
WARNING:google.auth.compute_engine._metadata:Compute Engine Metadata server unavailable on attempt 3 of 3. Reason: timed out
WARNING:google.auth._default:Authentication failed using Compute Engine authentication due to unavailable metadata server.
ERROR:root:Could not automatically determine credentials. Please set GOOGLE_APPLICATION_CREDENTIALS or explicitly create credentials and re-run the application.

 

We regenerated new credentials but to no use, the error persists. There hasn't been any configuration related changes with the app and there is no option of creating refresh-able token either.

What are our options here, can anyone suggest a way around it?

Thank You.

1 2 1,491
2 REPLIES 2

Hi, @nishantn 
Have you tackled it?
I have the same issue. I've generated new tokens, but neither of them doesn't work(
 

appas
New Member

I have this issue as well.

I was accessing my Google Drive through <URL removed by staff> on Linux, and it worked fine with the token I'd created for a day, but then doesn't, and there is this 

[203.634170] curl: data in: {
"error": "invalid_grant",
"error_description": "Token has been expired or revoked."
}

in the logs. 

 

I have also tried creating a new token using the same procedure that worked the first time, but to no avail. Both tokens show "Status Enabled" in the Cloud Console, and the Drive API is also shown as "Status Enabled".

What's going on? Why is my token "expired or revoked" when I try to use it, yet with a green checkmark in the Console?