'How to get authorisation code during angularfire installation?

During installation AngularFire by ng add @angular/fire I get following error

? Paste authorization code here: 1//0cpKD...
Authentication Error: Your credentials are no longer valid. Please run firebase login --reauth

For CI servers and headless environments, generate a new token with firebase login:ci

I try do put different code-like string from firebase site but no luck. I also try to run firebase login:ci, this generate long url, I copy it to browser and login to my google account, accept, and copy quite long token - but still no luck - it is wrong. How to get right authorization code?



Solution 1:[1]

I found following solution:

  1. Run firebase login:ci --no-localhost
  2. and open in browser generated link, login to your google account and accept
  3. copy code (which is few times shorter than token (~62 chars)
  4. TRICK: do NOT PASTE that code to console - but open new separate console
  5. In new console run ng add @angular/fire
  6. and paste that code during installation - now error not appear

Solution 2:[2]

What worked for me was to login to firebase.

So my steps that worked were following:

  1. Run firebase login:ci and follow instructions
  2. Run firebase login -> select your account, project etc...
  3. Run ng add @angular/fire -> it should ask you for what account to use, instead asking for authorization code

Had this issue today, first time using Firebase.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Dharman