googleapis / google-auth-library-nodejs

🔑 Google Auth Library for Node.js
Apache License 2.0
1.71k stars 374 forks source link

GaxiosError: Failed to retrieve verification certificates: request to https://www.googleapis.com/oauth2/v1/certs failed #1769

Closed sanjacob closed 6 months ago

sanjacob commented 6 months ago

Today out of the blue my login endpoint stopped working, and it seemingly never returned. After a few minutes of debugging, I realised the verifyIdToken method was still running. For some reason, the library tries to fetch certificates without any sort of warning or timeout for this, assuming the server will always be able to respond.

Then, I finally got this error:

GaxiosError: Failed to retrieve verification certificates: request to https://www.googleapis.com/oauth2/v1/certs failed

It is pretty much the same as googleapis/google-api-nodejs-client#3028.

I don't think it would be that hard to set a timeout on things like this, but maybe there's a reason for it? Who knows

Environment details

Steps to reproduce

  1. Call client.verifyIdToken()

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

danielbankhead commented 6 months ago

Actively working on this here: