title: NodeJS authentication with Firebase
body: <p>I would like to authenticate and keep sessions via NodeJS with Firebase. Client can't directly communicate with Firebase. </p>
  
  <p>In short:</p>
  
  <blockquote>
    <p>Client (browser) &lt;----> NodeJs(firebase-admin) &lt;----> Firebase</p>
  </blockquote>
  
  <p>I created Firebase client in NodeJS, then I used login method:</p>
  
  <pre><code>var firebaseClient = require('firebase');
  firebaseClient.initializeApp(config)
  firebaseClient.auth().signInWithEmailAndPassword(req.body.email, req.body.password).catch(function(error){
      console.log(error);
  })
  </code></pre>
  
  <p>and then I created route to check authenticated user: </p>
  
  <pre><code>app.get('/check',function(req,res){
      var user = firebaseClient.auth().currentUser
      console.log(user)
  })
  </code></pre>
  
  <p>This method only allows me keep 1 previously logged user.</p>
  
  <p>I would like to use firebase-admin, but I don't know how to keep session and authenticate users</p>