You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Authentication error when using database with emulators #2034
Operating System version: Docker / Linux / Debian 16
Firebase SDK version: firebase-admin@11.4.1
Firebase Product: database
Node.js version: 16.17
NPM version: 8.15
Describe the problem
Using the database per firebase-admin with emulators throws an error.
Steps to reproduce:
importadminfrom'firebase-admin'process.env.GCLOUD_PROJECT='demo'process.env.FIREBASE_AUTH_EMULATOR_HOST='localhost:9099'constdemoApp=admin.initializeApp({databaseURL: 'http://localhost:9000/?ns=demo-default-rtdb',})// This uses the emulator and works.awaitdemoApp.auth().listUsers().then(l=>console.log(l))// This fails with FirebaseAppError.// code: app/invalid-credential// 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 ENOTFOUND metadata.google.internal. Error code: ENOTFOUND"// in firebase-admin/lib/app/firebase-app.js:85:19awaitdemoApp.database().getRules().then(r=>console.log(r))
Activity