1. Summarize the problem
I am trying to generate a Firebase token to use in a Bitbucket deployment pipeline.
I have firebase-tools installed on a GCE VM, and I am not running firebase-tools on my local (Windows) machine.
On a GCE VM (my build machine), I cloned my code.
I installed firebase tools (on the GCE VM), then cd’d to my code/repo.
I ran: firebase init
Then I ran: firebase login:ci
, I was given a URL (in the GCE VM console),
[proc@mpi-dev-proc1 bin]$ firebase login:ci
Visit this URL on any device to log in:
https://accounts.google.com/o/oauth2/auth?client_id=....
I pasted that into my web browser on my Windows machine, I was asked to chose an account to continue to Firebase CLI.
I selected my GCP account.
I am presented with a dialog: “Firebase CLI” wants to access your Google Account…, I click on [Allow]
I am then redirected to a localhost URL:
http://localhost:9005/?state=445583251...
WHY?
I don’t have a server running on my local windows box, or anything on ‘localhost’ listening on port 9005,
Why am I presented with a URL to localhost:9005? I don’t get it, it makes no sense.
What is supposed to happen here?
I am trying to generate a firebase token to use on Bitbucket build/deploy pipelines.
2. Provide background including what you’ve already tried
A: See the above. I have also gone through Firebase documentation
3. Show some code
I ran this command on the GCE VM where I have firebase-tools installed (on a CentOS 7 VM)
firebase login:ci
4. Describe expected and actual results including any error messages
I need to generate a token for a Firebase deploy pipeline (bitbucket), I am working on a GCE VM with firebase-tools are installed.
2
Answers
That process on
localhost
is started by the Firebase CLI precisely to capture the redirect after you sign in and grant it permission. After this, the CLI continues (for me at least) and prints the token:If you check the URL, you’ll see the
localhost:%3A9005
in there. But as said, you shouldn’t have to do anything with that, as it’s just part of the internals of the CLI.Try with
firebase login:ci --no-localhost
, this will not start the localhost process, but you need to open the URL in the browser and paste back the code from the page to get the CI token.