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

I have issue to add the json key file #158

Closed
muhammadsamir11 opened this issue Jul 24, 2016 · 9 comments
Closed

I have issue to add the json key file #158

muhammadsamir11 opened this issue Jul 24, 2016 · 9 comments
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@muhammadsamir11
Copy link

Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information.

can you help me how can i fix that

@jmdobry
Copy link
Member

jmdobry commented Jul 24, 2016

Can you please provide more information about your setup? Did you run gcloud beta auth application-default login or are you trying to use a service account? Is your GOOGLE_APPLICATION_CREDENTIALS environment variable set to the correct value?

@aligajani
Copy link

@jmdobry Hey man, I am a bit confused. Do I have to use gcloud to use the natural language API, because it seems like an over kill. Can't I just supply the API key or the service account .json file and be ready to make calls from my PHP app using Guzzle. I haven't seen any API endpoint being accessed in such a non-trivial way, such that it makes beginner trials boring and tedious

@jmdobry
Copy link
Member

jmdobry commented Jul 25, 2016

@aligajani You are not required to use Google client libraries in order to communicate with Google APIs, but it is useful if you don't have time to implement your own client library.

If you're struggling to deploy one of the Node.js samples in this repository, then opening an issue here is good way to get help, only you must provide enough information for me to be able to reproduce the error before I can help you, e.g. which sample you're trying to deploy, stack trace, app.yaml, package.json, Node version, etc.

If you're looking for free general support, you can hop onto our Slack channels and post your question (there's even a php channel), or search Stack Overflow. Here are some more links to Google Cloud Platform developer communities.

If you're looking for paid technical support, you can find that on cloud.google.com/support.

@elibixby
Copy link
Contributor

@aligajani Just to clarify what @jmdobry is saying:

You don't need gcloud to use Google APIs. In this case you can just point to a service account json file:

export GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/service_account.json

@aligajani
Copy link

@elibixby Do you guys have a tutorial on how to use Natural Language API via PHP?

@jmdobry
Copy link
Member

jmdobry commented Jul 28, 2016

Not that I know of. When it appears it will appear here: https://github.com/GoogleCloudPlatform/php-docs-samples

@hung101
Copy link

hung101 commented Jan 20, 2017

i followed instructions from https://github.com/GoogleCloudPlatform/php-docs-samples having the same issue, by just passing projectid, it prompt this Error: Could not load the default credentials. Browse to https://developers.google.com/accounts/docs/application-default-credentials for more information.

@hung101
Copy link

hung101 commented Jan 20, 2017

I found the solution:

putenv(GOOGLE_APPLICATION_CREDENTIALS=/[filekey].json);

must set the environment variable

@jmdobry jmdobry closed this as completed Feb 8, 2017
@informaticosgb
Copy link

I solved it:

putenv('GOOGLE_APPLICATION_CREDENTIALS=../service-account.json');
$client = new Google_Client();
$client->useApplicationDefaultCredentials();
$client->setScopes(['https://www.googleapis.com/auth/analytics.readonly']);
$client->refreshTokenWithAssertion();
$token = $client->getAccessToken();
$accessToken = $token['access_token'];
dd($accessToken);

👍

@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 11, 2022
ace-n pushed a commit that referenced this issue Nov 11, 2022
ace-n pushed a commit that referenced this issue Nov 14, 2022
ace-n pushed a commit that referenced this issue Nov 15, 2022
ace-n pushed a commit that referenced this issue Nov 15, 2022
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
* updated CHANGELOG.md

* updated package.json

* updated samples/package.json
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
* updated CHANGELOG.md

* updated package.json

* updated samples/package.json
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
* updated CHANGELOG.md

* updated package.json

* updated samples/package.json
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
* updated CHANGELOG.md

* updated package.json

* updated samples/package.json
ahrarmonsur pushed a commit that referenced this issue Nov 16, 2022
* updated CHANGELOG.md

* updated package.json

* updated samples/package.json
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
* updated CHANGELOG.md

* updated package.json

* updated samples/package.json
jsimonweb pushed a commit to jsimonweb/nodejs-docs-samples that referenced this issue Dec 12, 2022
kweinmeister pushed a commit that referenced this issue Jan 11, 2023
🤖 I have created a release *beep* *boop*
---


### [1.6.1](googleapis/nodejs-retail@v1.6.0...v1.6.1) (2022-03-15)


### Bug Fixes

* remove gcloud_project env variable ([#156](googleapis/nodejs-retail#156)) ([16cefb4](googleapis/nodejs-retail@16cefb4))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
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

7 participants