Nodejs Firebase and Angular4 Authentication

Viewed 932

I have a client application, written in angular4 which communicates with a firebase server. Currently I'm trying to integrate a nodejs with firebase in a way that it will communicate with client app as well.

Firebase <----> Client (Angular4) <----> NodeJs(firebase-admin) <----> Firebase

I have setup a fire-admin configs:

var admin = require("firebase-admin");

var serviceAccount = require("./server/myfile.json");

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://mydb.firebaseio.com"
});

and able to retrieve a data like this:

  var db = admin.database();
  var ref = db.ref("messages");

  ref.once("value", function(snapshot) {
    console.log(snapshot.val());
  });

But how can I check in NodeJS server whether user in client app has logged in ? I need this NodeJS server to communicate with client and provide data and files if neccessary.

1 Answers
Related