0
votes

Getting following error, please suggest solution to get out of this-

{ Error: Credential implementation provided to initializeApp() via the "credential" property failed to fetch a valid Google OAuth2 access token with the following error: "Error fetching access token: invalid_grant (Invalid JWT: Token must be a short-lived token (60 minutes) and in a reasonable timeframe. Check your iat and exp values and use a clock with skew to account for clock differences between systems.)". There are two likely causes: (1) your server time is not properly synced or (2) your certificate key file has been revoked. To solve (1), re-sync the time on your server. To solve (2), make sure the key ID for your key file is still present at https://console.firebase.google.com/iam-admin/serviceaccounts/project. If not, generate a new key file at https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk.

2
this can happens if the date on your host machine where you run NodeJS process is not set right. - Anjal Saneen

2 Answers

0
votes

Solution is there in error.

There are two likely causes:

(1) your server time is not properly synced
(2) your certificate key file has been revoked.

To solve(1) re-sync the time on your server.
To solve (2), make sure the key ID for your key file is still present at https://console.firebase.google.com/iam-admin/serviceaccounts/project. If not, generate a new key file at https://console.firebase.google.com/project/_/settings/serviceaccounts/adminsdk.

mostly I think it's because of time on your host machine where you run NodeJS.

0
votes

To get an immediate sync, run ntpdate time.apple.com (or something similar)