Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

firebase login --no-localhost failed #5949

Open
zhangfangtaozft opened this issue Jun 9, 2023 · 10 comments
Open

firebase login --no-localhost failed #5949

zhangfangtaozft opened this issue Jun 9, 2023 · 10 comments

Comments

@zhangfangtaozft
Copy link

[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.

@google-oss-bot
Copy link
Contributor

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

@zhangfangtaozft
Copy link
Author

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.

@aalej
Copy link
Contributor

aalej commented Jun 9, 2023

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 aalej added the Needs: Author Feedback Issues awaiting author feedback label Jun 9, 2023
@zhangfangtaozft
Copy link
Author

firebase-tools

Hi @aalej , The firebase-tools@12.3.1, 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.

@google-oss-bot google-oss-bot added Needs: Attention and removed Needs: Author Feedback Issues awaiting author feedback labels Jun 9, 2023
@joehan joehan self-assigned this Jun 13, 2023
@ozeer
Copy link

ozeer commented Jun 15, 2023

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?

@renaiqin
Copy link

I also encountered this problem.
1689663240959

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

@lizh2023
Copy link

lizh2023 commented Aug 21, 2023

same question , need help

image

@Yetland
Copy link

Yetland commented Sep 18, 2023

image
I have the same problem.

@xlg
Copy link

xlg commented Mar 7, 2024

WechatIMG89

@joehan
Copy link
Contributor

joehan commented Mar 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants