Hello everyone,
I’m facing a blocking issue with the Gmail API and I’ve exhausted all standard troubleshooting steps. I’m hoping someone in the community or a Google expert might have seen this before.
The Problem:
When my application (a Python Cloud Function) tries to use a refresh token to get an access token for the Gmail API, it consistently fails with the error: “invalid_client: The OAuth client was not found.”
What I’ve Done:
1. **Project ID:** ‘fraud-digest-app-v2-469310’
2. **OAuth Client Type:** I’m using a ‘Desktop app’ type OAuth 2.0 Client ID.
3. **Verification:** I have repeatedly verified that the Client ID, Client Secret, and a freshly generated Refresh Token are correct. I’m storing them in Secret Manager and my function is reading them correctly.
4. **“Clean Slate” Test:** To rule out any state issues, I completely deleted all existing OAuth Client IDs in my project and created a brand new one from scratch. I immediately used these new credentials to generate a new refresh token and updated my secrets. The “invalid_client” error still persists.
My Conclusion:
The OAuth client clearly exists in the GCP console, but the authentication server reports that it does not. This seems like a platform-level issue, perhaps with the provisioning of OAuth clients in my project.
My Question:
Has anyone ever encountered a situation where a valid, newly created OAuth client is not found by the authentication system? Is there any known propagation delay or a hidden project/organization setting that could cause this?
Any help or insight would be greatly appreciated, as I am completely blocked.
Thank you!