Firebase fails to fetch a valid Google OAuth2 access token on Windows
See original GitHub issue- Operating System version: Windows 10
- Firebase SDK version: no SDK used
- Library version: firebase-admin@6.4.0
- Firebase Product: Realtime database
[REQUIRED] Step 3: Describe the problem
I built a script to download data from the Realtime database, on Mac. Here things work fine. But when tested the script on Windows I get the following error:
@firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential","message":"Credential implementation provided to initializeApp() via the \"credential\" property failed to fetch a valid Google OAuth2 access token with the following error: \"Failed to parse access token response: Error: Server responded with status 400.\"."}
Steps to reproduce:
Build a script that access data from Realtime database, using firebase-admin. Run it on Windows.
Relevant Code:
var admin = require("firebase-admin");
var serviceAccount = require("./adminsdk.json");
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
databaseURL: "https://<project-id>.firebaseio.com"
});
var db = admin.database();
var dataRef = db.ref("ref");
Issue Analytics
- State:
- Created 5 years ago
- Comments:14 (2 by maintainers)
Top Results From Across the Web
Firebase Admin failed to fetch a valid Google OAuth2 access ...
Started a clean app and had an issue where I couldn't even install firebase-admin . With a bit of digging I noticed that...
Read more >Admin Authentication API Errors | Firebase - Google
Here is a full list of the error codes and descriptions, ... auth/invalid-id-token, The provided ID token is not a valid Firebase ID...
Read more >Using OAuth 2.0 for Server to Server Applications | Authorization
With some Google APIs, you can make authorized API calls using a signed JWT directly as a bearer token, rather than an OAuth...
Read more >Get OAuth 2.0 tokens | Apigee X - Google Cloud
Does not require the Authorization header, however the client ID of the registered client app must be supplied in the request. When refreshing...
Read more >Authentication API Explorer - Auth0
OAuth2 Access Token. Send a valid Access Token in the Authorization header, using the Bearer authentication scheme. An example is the Get User...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
i am experiencing the same issue but when i am running my Nodejs application in a docker container.
@firebase/database: FIREBASE WARNING: {"code":"app/invalid-credential","message":"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: Error while making request: getaddrinfo EAI_AGAIN accounts.google.com:443. Error code: EAI_AGAIN\"."}clocks is synced, is there anyone with the same issue as me ?
Possible causes include:
Please use Stackoverflow if you wish to follow up with further questions.