How to change the Firebase user login ID from the command line (CLI)?

I am trying to log into firebase using credentials of, say, User-Alice.

But when I go through the authorization process, I get a message that I am logged in as a user-bean. This is not mentioned anywhere in the documentation , nor does it explain how to change the user I logged in to.

How can I change a registered Firebase user from User-Bob to User-Alice?

+30
command-line command-line-interface firebase
source share
7 answers

The easiest way to handle this is to log out of User-Alice and log in to User-Bob.

firebase logout firebase login 

But, if you are logged in as Alice user with a Google account in your browser, you need to log out of it first.

+74
source share

use this

 firebase login --reauth 

then you can change your account

+7
source share

First, your Google account should currently include 'User Alice'( userAlice@gmail.com ) in the default browser. When you firebase logout and then firebase will say

 $ firebase logout Logged out form ' userBob@gmail.com ' 

firebase login , Firebase will open a browser and receive a confirmation (enable or disable). When you accept / authorize, you can see the following in your terminal.

 $ firebase login Allow Firebase to collect anonymous CLI usage information? Yes Visit this URL on any device to log in: https://accounts.google.com/o/oauth2/auth?client_id=.... Waiting for authentication... Success! Logged in as ' userAlice@gmail.com ' 
+1
source share

With this command you can get a token string.

 firebase login:ci 

Then set FIREBASE_TOKEN env.

You can save any number of tokens and install it automatically using some utilities, such as dotenv.

+1
source share

You need to log out of Google Accounts in (using) your main browser (say Safari). And log in to the same browser as the correct user. Attempting to enter additional browsers (say, in Opera or Chrome) will not work. It should be the same browser as the Firebase CLI automatically opens after clicking firebase login . Secondary browsers will be ignored.

0
source share

If you have different google accounts, I recommend that you use the user profiles browser for it in Google Chrome .

Before entering firebase login , make sure to activate the corresponding browser window with the desired user profile .

This way you do not have to enter passwords when switching accounts.

0
source share

Command to log out and log in

 firebase logout firebase login 

see this link for more commands

https://www.npmjs.com/package/firebase-tools

0
source share

All Articles