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

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

Closed
willemmulder opened this issue Mar 31, 2017 · 3 comments
Closed
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@willemmulder
Copy link

willemmulder commented Mar 31, 2017

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.

@ace-n
Copy link
Contributor

ace-n commented Apr 3, 2017

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?

@willemmulder
Copy link
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.

@jmdobry
Copy link
Member

jmdobry commented Aug 21, 2017

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.

@jmdobry jmdobry closed this as completed Aug 21, 2017
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
NimJay pushed a commit that referenced this issue Nov 10, 2022
NimJay pushed a commit that referenced this issue Nov 10, 2022
ace-n pushed a commit that referenced this issue Nov 16, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
NimJay pushed a commit that referenced this issue Nov 18, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
NimJay pushed a commit that referenced this issue Nov 18, 2022
Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants