Error Google 'Token has been expired or revoked'
  • 17 Nov 2022
  • 1 Minute to read
  • Dark
    Light

Error Google 'Token has been expired or revoked'

  • Dark
    Light

Article Summary

This error will present itself in Connect job logs generally every 7 days if the google OAuth credential has not been verified with google or has not been published and is still in 'testing' mode. The error would look something like this in the job logs

ERROR getRecord(): java.io.IOException: Unable to refresh OAuth2 credential
Caused by: java.io.IOException: HTTPStatus: HTTP/1.1 400 Bad Request
{
"error": "invalid_grant",
"error_description": "Token has been expired or revoked."
}

This error can be resolved by going to console.cloud.google.com select the project your Rapid Identity OAuth credential is associated with at the top left.

image.png

On the left side in the toolbox menu there is APIs & Services (also seen in picture above). Select APIs & Services then in the new menu on the left select OAuth consent screen.

From here you can see two options if the credential was just made in testing there is a section called Publishing status.

image.png

Unless there is an intentional reason to limit the consent of this OAuth credentials this should be set to 'In production' as image shows. If it is in testing (intentionally or otherwise) new permissions will need to be granted every 7 days.

For edge cases you could also be receiving this error if Google deems the credential requires verification, more information on why that may be necessary is outlined here If that is the case for you at the top of your screen after flipping to 'In production' you will see a warning icon under Verification Status

image.png

You should follow the prompts by google to complete this verification or limit the OAuth credential to no longer require the verification as outlined here.


Was this article helpful?