Troubleshooting Request had invalid authentication credentials Error

Troubleshooting Request had invalid authentication credentials Error

Error Description

“error”:{“code”:401,”message”:”Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.”,”status”:”UNAUTHENTICATED”}}

If you are facing the above Google token expiration issues, our developers contacted Google support and received the following guidance:

Welcome to the Google Cloud Community!

You are correct that once the Publishing status is set to “In Production,” tokens shouldn’t expire after 7 days. Please try the following steps from this Stack Overflow thread[1]:

  1. Go to https://console.cloud.google.com/apis/credentials/consent and change the status from “Testing” to “Published.”
  2. Delete the current token file.
  3. Authorize the API again by signing into your Gmail account. You will encounter a warning screen; choose to proceed.
  4. Once done, you will receive a new token file.

If these steps do not resolve the issue, you can contact Google Cloud Support for further assistance. Thank you!