Repository navigation
Firebase login issue #10681
Description
[REQUIRED] Environment info
Firebase CLI Version: 15.21.0
Node.js Version: v24.17.0
Windows 11 x64
[REQUIRED] Test case
Download firebase-tools and authenticate from the terminal
[REQUIRED] Steps to reproduce
Execute firebase login, firebase login --reauth, firebase login --no-localhost and basically all versions of authentication available. Including ones with login:ci
[REQUIRED] Expected behavior
The authentication should complete successfully within the terminal
[REQUIRED] Actual behavior
The CLI opens a browser window for authentication.
The browser displays the following error message:
Oops!
Firebase CLI Login Failed
The Firebase CLI login request was rejected or an error occurred. Please run firebase login again or contact support if you continue to have difficulty logging in.
Meanwhile, the terminal outputs the following logs:
C:\Users\purus>firebase login --no-localhost --reauth --debug
[2026-06-18T11:51:31.707Z] >>> [apiv2][query] POST https://auth.firebase.tools/attest [none]
[2026-06-18T11:51:31.708Z] >>> [apiv2][body] POST https://auth.firebase.tools/attest {"session_id":"7966cbb3-142a-46b4-b571-e92f722dcd9c"}
[2026-06-18T11:51:32.374Z] <<< [apiv2][status] POST https://auth.firebase.tools/attest 200
[2026-06-18T11:51:32.374Z] <<< [apiv2][body] POST https://auth.firebase.tools/attest {"token":"yJah2vT3KoOXOwvO7LZda_h8aE0tl5KTwiG68UK3CZQ"}
To sign in to the Firebase CLI:
1. Take note of your session ID:
7966C
2. Visit the URL below on any device and follow the instructions to get your code:
https://auth.firebase.tools/login?code_challenge=AeIjhcJ5ZQk9VfnNwNbDRz1Qnjj4qZt69Hb7Ek9oRvM&session=7966cbb3-142a-46b4-b571-e92f722dcd9c&attest=yJah2vT3KoOXOwvO7LZda_h8aE0tl5KTwiG68UK3CZQ
3. Paste or enter the authorization code below once you have it:
√ Enter authorization code: 4/0AdkVLPx31jGpY5NaS430JKunW2-w9iGknbn-O3Vpn6QYsWG-aJHqiUGX7w3b5VAzNMaNlA
[2026-06-18T11:51:57.133Z] >>> [apiv2][query] POST https://accounts.google.com/o/oauth2/token [none]
[2026-06-18T11:51:57.134Z] >>> [apiv2][body] POST https://accounts.google.com/o/oauth2/token [omitted]
[2026-06-18T11:51:57.312Z] Token Fetch Error: FirebaseError: FetchError: Invalid response body while trying to fetch https://accounts.google.com/o/oauth2/token: Premature close
at RetryOperation._fn (F:\node-v24.17.0-win-x64\node_modules\firebase-tools\lib\apiv2.js:317:88)
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)
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
Error: Unable to authenticate using the provided code. Please try again.I tried to do a curl to the auth url as below.
C:\Users\purus>curl -X POST -I https://accounts.google.com/o/oauth2/token
HTTP/1.0 411 Length Required
Content-Type: text/html; charset=UTF-8
Referrer-Policy: no-referrer
Content-Length: 1564
Date: Thu, 18 Jun 2026 11:53:09 GMTI have treid to change different wifi band, mobile data using hotspot too.. still the same issue.
Activity
tobiaschristensen commentedon Jun 18, 2026
Same issue on MacOS with Firebase CLI 15.20.0. Works with Node 24.16.0.
Investigation by Claude:
Bisects to Node 24.17.0 (24.16.0 works); independent of firebase-tools version.
firebase login/--reauthfail on the token exchange —POST /o/oauth2/tokeningetTokensFromAuthorizationCode, via the apiv2 node-fetch client:--no-localhostfails the same way (samegetTokensFromAuthorizationCodepath), and the same call is used for token refresh inhosting:channel:deploy— there it surfaces as "credentials no longer valid" (it failed on Node 24.x but completed on 22.14 with unchanged credentials).Node bisection (6/6 runs each, macOS arm64; the linked report is Windows 11, so cross-platform):
Not a CLI-version issue: reproduced on firebase-tools 14.27 and 15.20.0 (this report is on 15.21.0) — all still use node-fetch v2 for this call, so upgrading the CLI doesn't help.
node-fetch-specific. Same endpoint, Node 24.17.0:
curlcompletes (400/411) and Node's built-infetch/undici returns 400 (6/6); only node-fetch v2 throws Premature close (6/6):24.17.0 is a security release (11 CVEs); I haven't bisected the exact commit, but the likeliest candidate is CVE-2026-48931 ("fix response queue poisoning in
http.Agent"), given node-fetch's knownhttp.AgentPremature-close behavior — the TLS fixes look less relevant. Since undici works on 24.17, moving apiv2 off node-fetch to the built-infetchshould resolve it. Workaround meanwhile: Node 24.16 (predates this security release).Purus commentedon Jun 18, 2026
Wow.. you saved me from lot of frustration.
It worked with 24.16.0. thanks a lot.
SveBo commentedon Jun 18, 2026
Node 22.23 also breaks firebase login, node 22.22 works!
joehan commentedon Jun 18, 2026
Reproduced this issue too - unfortunately, I don't believe that there is any action that can be taken in this repo to fix the issue. Root cause here is to be nodejs/node#63989, which is breaking google-auth-library. Fortunately, the Node maintainers seem to be actively responding.
As others have mentioned - if you are experiencing this issue, please downgrade to Node 22.22.x or Node 24.16.x and bump nodejs/node#63989
pearigee commentedon Jun 18, 2026
This may not impact newer versions of google-auth-library (which are using a newer version of gaxios->node-fetch).
I see this repo is using
"google-auth-library": "^9.11.0",. Upgrading to the current version10.7.0may resolve this issue.filoscoder commentedon Jun 19, 2026
Confirmed Node 24.16 is working.
Ziad-Mahmoud commentedon Jun 20, 2026
It Works by downgrade from 17 to 16
nvm install 24.16.0
nvm use 24.16.0
Thanks a lot both to make an issue Purus and to fix it tobiaschristensen
basitkhan32 commentedon Jun 21, 2026
Worked with:
cjsewell commentedon Jun 22, 2026
I (well claude really) work around this with
no-keepalive.cjs:
danigc commentedon Jun 23, 2026
Thanks a lot. As commented before by @SveBo 22.23 released five days ago also breaks login
JamesJoyceGit commentedon Jun 28, 2026
In case someone else has this happen unexpectedly - I added caching to by git actions - and somehow it decided to use v24.17! And failed on google auth login...
So - I fixed it to v24.18.0 - and this solved the issue
- name: Setup node uses: actions/setup-node@v6 with: node-version: 24.18.0 cache: "npm"greg-md commentedon Jul 3, 2026
I am having the same issue, but it does open the browser and on login it breaks with 400 error on https://accounts.google.pt/accounts/SetSID
Any ideas? Switching to v24.16.0 did not help.
mdulc928 commentedon Jul 13, 2026
Downgrading to
22.22worked. Thanks for all the suggestions, guys!