Skip to content

New to Google Cloud Platform; running the sample gives auth error? #329

Description

@willemmulder

I'm new to the Google Cloud Platform and was happy to find this repo of examples.

However, when I simply follow the instructions I seem to get an auth error?

node recognize.js stream ./resources/audio.raw -e LINEAR16 -r 16000

Gives me

UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information.

Which points to a page full of information about authentication, except the information I'm looking for: how can I simply pass an API key to the Speech client so it just simply works?

Could the documention be updated to instruct step-by-step how to do auth? Would it be possible to make that work something like

Speech({
  apikey: [somekey]
});

? Or is there a reason not to make it that easy?
Right now it feels like there are so many implicit assumptions and things around auth that scare newcomers away.

Would be happy to help in any way once I understand how it works.

Activity

  1. ace-n commented on Apr 3, 2017

    @ace-n
    Contributor

    You need to authenticate with an account (either a standard Google user account, or a Google Cloud Platform service account).

    Does this part of that page help?

  2. willemmulder commented on Apr 5, 2017

    @willemmulder
    Author

    Yes that seems to be the important part; thanks.

    Could we update the documentation with two parts?

    1. Mention the environment variables explicitly, so that the example code runs without 'unexpected' issues
    2. Also explain how the API can be used with an API key. I don't seem to understand how that works yet either.
  3. jmdobry commented on Aug 21, 2017

    @jmdobry
    Member

    For 1), this repo has setup instructions for running samples.

    For 2) we don't want to encourage the use of API keys. The more secure authentication method is with a Service Account. The setup instructions in 1) should help with 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

    Labels

    🚨This issue needs some love.triage meI really want to be triaged.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions