Firebase CLI Authentication through token

cicciosgamino picture cicciosgamino · Oct 14, 2015 · Viewed 7k times · Source

I followed the steps described in the official GitHub tutorial for use the Firebase CLI (Command Line) with a CI system (simple OS without browser integrate). I use my PC to login in firebase and get the token (from the browser procedure). I copied the token on the other system and I passed the token in all command but it does not work. I get the message that I need to be authenticate for doing these operations:

firebase login 
firebase prefs:token 

copy and use the token in other system

firebase list --token sdfgfdsg...... 

What's the problem?

Answer

Ronnie Royston picture Ronnie Royston · May 16, 2017

Using a machine with a browser and firebase tools installed, run firebase login:ci --no-localhost and paste the resulting key from the firebase CLI tool into an Environmental Variable and name it FIREBASE_TOKEN (not $FIREBASE_TOKEN).

In your deployment, say

npm install -g firebase-tools
firebase deploy