We are experiencing intermittent issues with our Cloud Run service authentication, which is causing disruption in our operations. Our architecture utilizes a Node.js service as our API gateway, which is not hosted on GCP. For the authentication process, we are using the google-auth-library to fetch ID tokens. These tokens are then added to our request headers as follows:
{
headerKey: "X-Serverless-Authorization",
headerValue: `Bearer ${idToken}`
}
However, this authentication process seems to be sporadically failing. Sometimes it works seamlessly, and at other times, it does not, leading to failed requests. This lack of reliability is causing significant issues for our service.
We have attempted to isolate the problem but have been unable to identify any patterns or causes for this inconsistent behavior. There are no apparent network issues, and the problem occurs across different devices and locations. It seems to be an issue within the Cloud Run service or the google-auth-library itself.
Any assistance in diagnosing and resolving this problem would be greatly appreciated. We would also appreciate any additional information about best practices for using the google-auth-library with Cloud Run and a non-GCP hosted Node.js API gateway.
Hi @kombine,
Welcome to the Google Cloud Community!
Try the following troubleshooting options:
For best practices in using:
Let me know if it helped, thanks!