Anderson Pimentel Anderson Pimentel -3 years ago 214
Node.js Question

Firebase credentials error

I got some 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 and in a
reasonable timeframe)\".

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 firebase project. If not, generate a new key file at service account setting.

When I try to use Firebase Admin SDK in Nodejs.

At my local computer it works, but when I try to use in AWS server, I got this error. Some tip?

Answer Source

This is usually because your server clock is out of sync. You will need to adjust and sync the clock on your AWS VM instance. See Token must be a short-lived token and in a reasonable timeframe

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download