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

API key authentication doesn't work for Cloud Natural Language #2498

Closed
anotheri opened this issue Jul 31, 2017 · 3 comments
Closed

API key authentication doesn't work for Cloud Natural Language #2498

anotheri opened this issue Jul 31, 2017 · 3 comments
Assignees
Labels
type: question Request for information or clarification. Not an issue.

Comments

@anotheri
Copy link

Environment details

  • OS: Ubuntu
  • Node.js version: 8.1.4
  • npm version: 5.0.3
  • "@google-cloud/language": "^0.11.0"

Steps to reproduce

  const language = require( '@google-cloud/language' )( {
    projectId: <MY_PROJECT_ID>,
    key: <MY_API_KEY>
  } );

It throws:

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.

It works with credentials object and with config json file, but it fails with API key.
Please advise or fix.

@anotheri
Copy link
Author

And it looks like API key auth doesn't work for other packages as well, see: #1424

@lukesneeringer
Copy link
Contributor

This is something that just got a decent bit of discussion internally on the Python side, where we did have support and actively removed it. Essentially, API keys are a discouraged form of authentication at this point, and we do not intend to support them in client libraries.

@anotheri
Copy link
Author

anotheri commented Aug 4, 2017

@lukesneeringer thanks for the answer; that'd be super helpful to add a clear note that API key auth is not supported in the documentation then.

@stephenplusplus stephenplusplus added auth type: question Request for information or clarification. Not an issue. labels Aug 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question Request for information or clarification. Not an issue.
Projects
None yet
Development

No branches or pull requests

3 participants