Skip to content

firebase CLI auth error in 13.13.1 #7429

Closed

Description

@solarpush

[REQUIRED] Environment info

13.13.1
firebase-tools:

Platform:
windows

[REQUIRED] Test case

[REQUIRED] Steps to reproduce

Well i have finaly re-install the 13.13.1 firebase-tools package and it's all.
I seen it's an authentication issue.

all commande fails:

  • firebase emulators:start
  • firebase use

[REQUIRED] Expected behavior

Get project information

[REQUIRED] Actual behavior

{"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}

Debug log

[debug] [2024-07-10T19:28:20.764Z] ----------------------------------------------------------------------
[debug] [2024-07-10T19:28:20.766Z] Command:       C:\Program Files\nodejs\node.exe C:\Users\pierr\AppData\Roaming\npm\node_modules\firebase-tools\lib\bin\firebase.js use dev --debug
[debug] [2024-07-10T19:28:20.766Z] CLI Version:   13.13.1
[debug] [2024-07-10T19:28:20.767Z] Platform:      win32
[debug] [2024-07-10T19:28:20.767Z] Node Version:  v20.11.0
[debug] [2024-07-10T19:28:20.767Z] Time:          Wed Jul 10 2024 21:28:20 GMT+0200 (heure d’été d’Europe centrale)
[debug] [2024-07-10T19:28:20.767Z] ----------------------------------------------------------------------
[debug] 
[debug] [2024-07-10T19:28:20.823Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2024-07-10T19:28:20.824Z] > authorizing via signed-in user ([email protected])
[debug] [2024-07-10T19:28:20.829Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects/neosilver-back-dev [none]
[debug] [2024-07-10T19:28:20.958Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects/neosilver-back-dev 401
[debug] [2024-07-10T19:28:20.958Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects/neosilver-back-dev {"error":{"code":401,"message":"Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.","status":"UNAUTHENTICATED"}}
[debug] [2024-07-10T19:28:20.959Z] HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.
[error] 
[error] Error: Invalid project selection, please verify project dev exists and you have access.

Activity

  1. google-oss-bot commented on Jul 10, 2024

    @google-oss-bot
    Collaborator

    This issue does not have all the information required by the template. Looks like you forgot to fill out some sections. Please update the issue with more information.

  2. aalej commented on Jul 10, 2024

    @aalej
    Contributor

    Hey @solarpush. I think you meant to run the firebase projects:list command. I tried running firebase projects:list using firebase-tools v13.3.1 and no errors were raised.

    If you’re still encountering issues, could you try running firebase projects:list --debug and share the firebase-debug.log with us? Passing the --debug flag provides a more detailed log that we can use to check what caused the error.

  3. added
    Needs: Author Feedback
    on Jul 10, 2024
  4. solarpush commented on Jul 10, 2024

    @solarpush
    Author

    Hello, I'm sorry for this empty issue, this morning I worked and it happened when I had no time to explain.
    So I tried again and everything's fine...
    I think it's because I have a script that updates firebase-tools every time I launch the emulator and maybe npm i -g firebase-tools got an error.
    I remember to --debug for last issue and add directly in Issue.
    Thanks for you time.

  5. solarpush commented on Jul 10, 2024

    @solarpush
    Author

    @aalej I reopen finally I have a time now to help you to reproduce if you have time too.

  6. added and removed
    Needs: Author Feedback
    on Jul 10, 2024
  7. changed the title [-]firebase project:list not working in 13.13.1[/-] [+]firebase CLI auth error in 13.13.1[/+] on Jul 10, 2024
  8. joehan commented on Jul 10, 2024

    @joehan
    Member

    Hi @solarpush - can you try running firebase login --reauth and then retrying the failing commands?

  9. solarpush commented on Jul 11, 2024

    @solarpush
    Author

    Hi @solarpush - can you try running firebase login --reauth and then retrying the failing commands?

    Yes i have try to :
    Login:use ... and not working
    Login:ci not working

    But login --reauth have worked

  10. solarpush commented on Jul 11, 2024

    @solarpush
    Author

    @joehan @aalej thanks you
    The command :
    'Firebase login --reauth' solve the problem for the moment i try this morning all use cases i need but the project switching work properly now with the 13.13.1 version

  11. solarpush commented on Jul 11, 2024

    @solarpush
    Author

    Informations for reproduce it :
    npm i -g [email protected]
    firebase use "project-name" (work)
    npm i -g [email protected]
    firebase use "project-name" (not work )

    firebase login --reauth
    firebase use "poject-name" (work)

  12. if-fi commented on Jul 11, 2024

    @if-fi

    I'm running into the same problem. We use firebase-tools appdistribution in our CI.
    Our CI jobs started failing with HTTP Error: 401, Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project. on [email protected].

    We pinned the version to @13.13.0 and everything works fine.

  13. klausmyrseth commented on Jul 11, 2024

    @klausmyrseth

    Just to verify, the version upgrade give me just short time on the token for every reauth so I am downgrading myself to previous version which worked flawlessly.

    After the downgrade it works without even reauthenticating, so there is something fishy going on.

  14. Gbuomprisco commented on Jul 11, 2024

    @Gbuomprisco

    Also running into the same issue. It works after re-authenticating, and then it does not.

  15. joehan commented on Jul 11, 2024

    @joehan
    Member

    Hey all, we made some changes in this past release to better support auth on idx.google.com that I suspect are the cause of this issue. I'm actively working on a fix for this to go out ASAP - in the interim, please either downgrade to 13.13.0 or run firebase login --reauth

    Sorry for the inconvience!

  16. joehan commented on Jul 11, 2024

    @joehan
    Member

    We've just released 13.13.2, which should fix this issue. If you continue to see problems, please open a new issue to let us know.

  17. solarpush commented on Jul 11, 2024

    @solarpush
    Author

    Re @joehan , I worked today on the 13.13.1 package and experienced several disconnections when launching the emulator or other operations.
    It's possible that I'm using firebase use "project" in different folders and subfolders from the terminal.
    This wasn't a problem before, but I have the impression that the context is lost when changing path when starting the emulator.
    If that can help you.
    thanks

  18. dmiedev commented on Nov 19, 2024

    @dmiedev

    I had the same issue:

    Failed to write android google-services.json file write for build configuration: "src/staging". Please report this issue at:https://github.com/invertase/flutterfire_cli. Exception: Exception: Failed to obtain an access token for making Firebase Management REST API requests. Status code: 400. Response body: {
      "error": "invalid_grant",
      "error_description": "Bad Request"
    }
    

    firebase login --reauth fixed this!

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions