GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Provide better error messages for common auth errors · Issue #286 · googleapis/google-cloud-node

Provide better error messages for common auth errors #286

New issue
Copy link
New issue
Copy link
Closed
Closed
Provide better error messages for common auth errors#286
Copy link
Assignees
stephenplusplus
Labels
🚨This issue needs some love.library: cloud-profilerIssues transferred from another repositorytriage meI really want to be triaged.
Milestone
Core Stable

Description

@silvolu
silvolu
opened on Nov 6, 2014
Issue body actions

@ryanseys suggested to add more sanity checking in #261 (comment), but I'm not sure we can do more than checking that the .json file or the credentials object contains the expected fields. #261 (comment) shows that it doesn't solve the problem of a developer using a non-key value for private_key when passing in a credentials object.
I think we could at least intercept the error and give back a more meaningful explanation, something like "There is something wrong with your key. If you are using a .json file, make sure that on the Google Developer Console you've generated the file for a ClientId of Service Account type....."

Activity

Next
  1. silvolu
    added this to the This milestone has been deleted milestone on Nov 6, 2014
  2. stephenplusplus commented on Nov 6, 2014

    @stephenplusplus
    stephenplusplus
    on Nov 6, 2014
    Contributor
    More actions

    I think we need to solve this problem on the docs level. (Yeah, I know we're trying pretty hard!) The problem here is, if I pass a faulty private_key, it is going to attempt to be signed via jws, where an error is thrown.

    We would have to try/catch authorizing API requests. Should we open an issue on node-gapitoken to use a try catch around the sign, or let it go?

  3. silvolu commented on Nov 7, 2014

    @silvolu
    silvolu
    on Nov 7, 2014
    ContributorAuthor
    More actions

    Let's wait for @ryanseys new thing.

  4. stephenplusplus commented on Nov 14, 2014

    @stephenplusplus
    stephenplusplus
    on Nov 14, 2014
    Contributor
    More actions

    @ryanseys how does your lib handle this situation? Are we resolved?

  5. ryanseys commented on Nov 14, 2014

    @ryanseys
    ryanseys
    on Nov 14, 2014
    Contributor
    More actions

    gtoken surrounds the signing of the JWT with a try/catch and it will return the error thrown in the callback if the signing fails. gtoken is designed to never throw. If it does, that's a bug and I should be punished accordingly (and you should open an issue). You can see that specific case here.

  6. stephenplusplus commented on Nov 14, 2014

    @stephenplusplus
    stephenplusplus
    on Nov 14, 2014
    Contributor
    More actions

    And this is where I return that error, if there was one? https://github.com/stephenplusplus/google-service-account/blob/master/connection.js#L72

  7. ryanseys commented on Nov 14, 2014

    @ryanseys
    ryanseys
    on Nov 14, 2014
    Contributor
    More actions

    Yes sir.

  8. stephenplusplus
    added a commit that references this issue on Nov 17, 2014

    provide better error messaging - fixes googleapis#286

    This issue will close once commit cad0fa2 is merged into the 'master' branch.
    cad0fa2
  9. stephenplusplus
    closed this as completedin cad0fa2on Nov 17, 2014
  10. ryanseys
    added a commit that references this issue on Nov 17, 2014

    Merge pull request #303 from stephenplusplus/spp--error-messaging

    This issue will close once commit 0ef2c4a is merged into the 'main' branch.
    0ef2c4a
  11. jgeewax
    added
    auth
    on Feb 2, 2015
  12. jgeewax
    modified the milestones: Core Stable, This milestone has been deleted on Feb 2, 2015
  13. yoshi-automation
    added
    triage meI really want to be triaged.
    🚨This issue needs some love.
    on Apr 6, 2020
  14. 38 remaining items

  15. sofisl
    added
    library: cloud-profilerIssues transferred from another repository
    on Feb 7, 2026
  16. sofisl
    added a commit that references this issue on Feb 17, 2026

    chore(deps): update dependency @types/sinon to v7 (#286)

    c22d8aa
  17. GautamSharda
    added a commit that references this issue on Feb 23, 2026

    fix: improve error item message for plain objects (#286)

    9884186
  18. sofisl
    added 2 commits that reference this issue on Feb 24, 2026

    Adding ProtobufJS support (#286)

    ab335f0

    refactor(ts): merge initial TypeScript conversion (#334)

    943b50c
  19. GautamSharda
    added 2 commits that reference this issue on Feb 25, 2026

    chore: remove unused proto imports (#286)

    715d876

    fix: improve error item message for plain objects (#286)

    8299976
  20. sofisl
    added 2 commits that reference this issue on Feb 26, 2026

    chore: ignore package-lock.json (#286)

    a36de8b

    chore: migrate code from googleapis/gcp-metadata (#53)

    fa9a454
  21. codyoss
    added 2 commits that reference this issue on Mar 9, 2026

    chore: disable renovate dependency dashboard (#1194) (#286)

    87607b4

    chore: disable renovate dependency dashboard (#1194) (#286)

    7f8afc4
  22. GautamSharda
    added 3 commits that reference this issue on Mar 11, 2026

    build: fix codecov uploading on Kokoro (#286)

    fdde6ee

    test(nodejs): remove 15 add 16 (#1322) (#286)

    1a1c90c

    test(nodejs): remove 15 add 16 (#1322) (#286)

    3ae5401
  23. thiyaguk09
    added a commit that references this issue on Mar 18, 2026

    refactor(ts): merge initial TypeScript conversion (googleapis#334)

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

Metadata

Metadata

Assignees

  • @stephenplusplus
    stephenplusplus

Labels

🚨This issue needs some love.library: cloud-profilerIssues transferred from another repositorytriage meI really want to be triaged.

Type

No type

Projects

No projects

    Milestone

    • Core Stable

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.