firebase-tools icon indicating copy to clipboard operation
firebase-tools copied to clipboard

firebase login --no-localhost failed

Open zhangfangtaozft opened this issue 2 years ago • 10 comments

[REQUIRED] Environment info

firebase-tools: firebase login --no-localhost

Platform: MacOS

[REQUIRED] firebase login --no-localhost, But Failed.

frank@localhost ~ % firebase login --no-localhost i 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.

To sign in to the Firebase CLI:

  1. Take note of your session ID:

    1FC00

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

    https://auth.firebase.tools/login?code_challenge=lNJrRQF18kC-3Z5ugT9PiFmMXMsQyHji3RXlAsrBKaw&session=1fc00e87-ef04-4510-80e8-250aa3f865da&attest=zuxDjPaiZYUVWXCYx8TomlM4FIOamZ_fCew-chMYDGI

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

? Enter authorization code: 4/0AbUR2VNOsVdLwU72BmEFf8_8Jq9znfkPkaTGXbb11aSWaMvUEmhs02aZMCaAoyngdeK7eg

Error: Unable to authenticate using the provided code. Please try again. frank@localhost ~ %

[REQUIRED] Steps to reproduce

[REQUIRED] Expected behavior

[REQUIRED] Actual behavior

Error: Unable to authenticate using the provided code. Please try again.

zhangfangtaozft avatar Jun 09 '23 09:06 zhangfangtaozft

This issue does not seem to follow the issue template. Make sure you provide all the required information.

google-oss-bot avatar Jun 09 '23 09:06 google-oss-bot

It's all the information:

frank@localhost ~ % firebase login --no-localhost i 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.

To sign in to the Firebase CLI:

  1. Take note of your session ID:

    1FC00

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

    https://auth.firebase.tools/login?code_challenge=lNJrRQF18kC-3Z5ugT9PiFmMXMsQyHji3RXlAsrBKaw&session=1fc00e87-ef04-4510-80e8-250aa3f865da&attest=zuxDjPaiZYUVWXCYx8TomlM4FIOamZ_fCew-chMYDGI

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

? Enter authorization code: 4/0AbUR2VNOsVdLwU72BmEFf8_8Jq9znfkPkaTGXbb11aSWaMvUEmhs02aZMCaAoyngdeK7eg

Error: Unable to authenticate using the provided code. Please try again.

zhangfangtaozft avatar Jun 09 '23 09:06 zhangfangtaozft

Hi @zhangfangtaozft, thanks for reaching out to us. I tried to reproduce the error, but I encountered no issues when running firebase login --no-localhost.

Could you let us know which version of firebase-tools you’re using? If you’re not using the latest version, I would recommend upgrading to get the latest updates and bug fixes.

Also, could you provide the output debug logs by adding the --debug flag? You could do this by running firebase login --no-localhost --debug. Passing the --debug flag provides more information on what could’ve caused the error.

aalej avatar Jun 09 '23 12:06 aalej

firebase-tools

Hi @aalej , The [email protected], and I tried with firebase login --no-localhost --debug, And the result is :frank@bogon ~ % firebase login --no-localhost --debug i 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. [2023-06-09T16:16:34.660Z] >>> [apiv2][query] POST https://auth.firebase.tools/attest [none] [2023-06-09T16:16:34.662Z] >>> [apiv2][body] POST https://auth.firebase.tools/attest {"session_id":"711b1e64-a938-44f6-8c98-d12b535e094a"} [2023-06-09T16:16:35.253Z] <<< [apiv2][status] POST https://auth.firebase.tools/attest 200 [2023-06-09T16:16:35.255Z] <<< [apiv2][body] POST https://auth.firebase.tools/attest {"token":"AKdhi-jWDxnBp3YS2LkSi-L-Z63blFPA37hJkPXhhGE"}

To sign in to the Firebase CLI:

  1. Take note of your session ID:

    711B1

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

    https://auth.firebase.tools/login?code_challenge=XCjV-J5JpoPgH2ft_lx39gsIvvf_o8rMD6zROW1_wgU&session=711b1e64-a938-44f6-8c98-d12b535e094a&attest=AKdhi-jWDxnBp3YS2LkSi-L-Z63blFPA37hJkPXhhGE

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

? Enter authorization code: 4/0AbUR2VNKUAc17MYcLUCPlkz9EOOQQVcNv3NgEluUXjO0760EzQOMMPHri0swpwVi40ALBQ [2023-06-09T16:16:55.087Z] >>> [apiv2][query] POST https://accounts.google.com/o/oauth2/token [none] [2023-06-09T16:16:55.091Z] >>> [apiv2][body] POST https://accounts.google.com/o/oauth2/token [omitted] [2023-06-09T16:18:10.137Z] Token Fetch Error: FirebaseError: Failed to make request to https://accounts.google.com/o/oauth2/token at RetryOperation._fn (/Users/frank/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/apiv2.js:242:31) at processTicksAndRejections (node:internal/process/task_queues:96:5)

Error: Unable to authenticate using the provided code. Please try again.

zhangfangtaozft avatar Jun 09 '23 16:06 zhangfangtaozft

I also encountered this problem.

image

Firebase CLI Version: 12.3.1 Node Version: 18.16.0

I used a proxy service, does this have an impact?

ozeer avatar Jun 15 '23 15:06 ozeer

I also encountered this problem. 1689663240959

Node.js v18.16.1 firebase v12.4.4 Hope to help solve as soon as possible

renaiqin avatar Jul 18 '23 07:07 renaiqin

same question , need help

image

lizh2023 avatar Aug 21 '23 07:08 lizh2023

image I have the same problem.

Yetland avatar Sep 18 '23 08:09 Yetland

WechatIMG89

xlg avatar Mar 07 '24 04:03 xlg

Hey all, sorry to see the issues you've run into. The most common cause of this issue is proxy misconfiguration, which has proven to be quite difficult to debug over Github. The easiest immediate workaround is, if possible, disable any proxies you are using and try to firebase login --no-localhost again. Once you've run that, you should be good to reenable your proxy and use the CLI.

joehan avatar Mar 07 '24 17:03 joehan