Authentication problem with firebase 3.0 in Node.js

Asked

Viewed 106 times

1

Because firebase has upgraded to version 3.0 and it is necessary to migrate to the new version, a problem has arisen regarding my Node server authentication. The code is like this

var firebase = require('firebase');

var config = {
  apiKey: "<minha apiKey>",
  authDomain: "<meu domínio de autenticação>",
  databaseURL: "<url do banco>",
  storageBucket: "<minha storageBucket>",
  serviceAccount: "<nome do arquivo gerado pela conta de serviço>.json"
};

firebase.initializeApp(config);

When running npm start, the following error appears:

FIREBASE WARNING: Provided authentication credentials are invalid. 
This   usually indicates your FirebaseApp instance was not initialized correctly. 
Make sure your apiKey and databaseURL match the values provided for your 
app at 'https://console.firebase.google.com/', or if you're using 
a service account, make sure it's authorized to access the specified 
databaseURL and is from the correct project.

Being that I got all the config information on my own project console on firebase.

  • Your setup seems correct second the API. Are you sure those keys are correct?

  • Yes, I took from my project on the console, but I wonder if this has ever happened to anyone, because I suspect it is some bug

  • @straightener this happened to me, cop all other items less the serviceAccount and the databaseURL

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.