firebase / firebase/firebase-tools

Firebase CLI Login Failed - Error on firebase login

Open
#8,304 24 comments 0 reactions 1 assignee Claimed by @aalej View on GitHub
api: core Needs: Attention type: bug
Dominant language
TypeScript
Stars
4.5k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
84

Description

### [REQUIRED] Environment info

Firebase CLI Version: 13.33.0
Node.js Version: v20.10.0
Linux 6.12.13-amd64

### [REQUIRED] Test case

Download firebase-tools or firebase-cli 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:
```
Firebase optionally collects CLI and Emulator Suite usage and error reporting information to help improve our products. Data is collected in accordance with Google's privacy policy (https://policies.google.com/privacy) and is not used to identify you.

? Allow Firebase to collect CLI and Emulator Suite usage and error reporting
information? Yes
i To change your data collection preference at any time, run `firebase logout` and log in again.

Visit this URL on this device to log in:
https://accounts.google.com/o/oauth2/auth?client_id=563584335869-fgrhgmd47bqnekij5i8b5pr03ho849e6.apps.googleusercontent.com&scope=email%20openid%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloudplatformprojects.readonly%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Ffirebase%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fcloud-platform&response_type=code&state=842300911&redirect_uri=http%3A%2F%2Flocalhost%3A9005

Waiting for authentication...
[2025-03-10T15:31:09.297Z] >>> [apiv2][query] POST https://accounts.google.com/o/oauth2/token [none]
[2025-03-10T15:31:09.302Z] >>> [apiv2][body] POST https://accounts.google.com/o/oauth2/token [omitted]
[2025-03-10T15:31:09.818Z] *** [apiv2] error from fetch(https://accounts.google.com/o/oauth2/token, {"headers":{},"method":"POST","body":{"_overheadLength":543,"_valueLength":208,"_valuesToMeasure":[],"writable":false,"readable":true,"dataSize":0,"maxDataSize":2097152,"pauseStreams":true,"_released":true,"_streams":[],"_currentStream":null,"_insideLoop":false,"_pendingNext":false,"_boundary":"--------------------------774456112272132751061107","_events":{},"_eventsCount":1}}): FetchError: request to https://accounts.google.com/o/oauth2/token failed, reason:
[2025-03-10T15:31:09.820Z] Token Fetch Error: FirebaseError: Failed to make request to https://accounts.google.com/o/oauth2/token
at RetryOperation._fn (/home/darkreaper/.nvm/versions/node/v20.10.0/lib/node_modules/firebase-tools/lib/apiv2.js:261:31)
at process.processTicksAndRejections (node:internal/process/task_queues:95: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
[2025-03-10T15:31:09.842Z] >>> [apiv2][query] POST https://auth.firebase.tools/attest [none]
[2025-03-10T15:31:09.843Z] >>> [apiv2][body] POST https://auth.firebase.tools/attest {"session_id":"0488bc1a-09e8-4374-bc7d-ea8f46f10975"}
[2025-03-10T15:31:10.856Z] <<< [apiv2][status] POST https://auth.firebase.tools/attest 200
[2025-03-10T15:31:10.857Z] <<< [apiv2][body] POST https://auth.firebase.tools/attest {"token":"jEMefqcNhsrJC0LEiByNS8ZrFqAjvarPBWTTsJuQeu0"}

To sign in to the Firebase CLI:

1. Take note of your session ID:

0488B

2. Visit the URL below on any device and follow the instructions to get your code:

https://auth.firebase.tools/login?code_challenge=1N6ynEeq4AgfXbKNiDvos3Lmn4m1kIJzQl0WB9bsQr8&session=0488bc1a-09e8-4374-bc7d-ea8f46f10975&attest=jEMefqcNhsrJC0LEiByNS8ZrFqAjvarPBWTTsJuQeu0

3. Paste or enter the authorization code below once you have it:

? Enter authorization code:

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.