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 — I have issue to add the json key file · Issue #158 · GoogleCloudPlatform/nodejs-docs-samples

I have issue to add the json key file  #158

New issue
Copy link
New issue
Copy link
Closed
Closed
I have issue to add the json key file #158
Copy link
Labels
🚨This issue needs some love.triage meI really want to be triaged.

Description

@muhammadsamir11
muhammadsamir11
opened on Jul 24, 2016
Issue body actions

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

Activity

Next
  1. jmdobry commented on Jul 24, 2016

    @jmdobry
    jmdobry
    on Jul 24, 2016
    Member
    More actions

    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?

  2. aligajani commented on Jul 24, 2016

    @aligajani
    aligajani
    on Jul 24, 2016
    More actions

    @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

    Reacted by Marc de Ruijter, shrutirajagopal and Jimmy McCabe
  3. jmdobry commented on Jul 25, 2016

    @jmdobry
    jmdobry
    on Jul 25, 2016
    Member
    More actions

    @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.

  4. elibixby commented on Jul 25, 2016

    @elibixby
    elibixby
    on Jul 25, 2016
    Contributor
    More actions

    @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
    
    Reacted by Timo Kleemann
  5. aligajani commented on Jul 27, 2016

    @aligajani
    aligajani
    on Jul 27, 2016
    More actions

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

  6. jmdobry commented on Jul 28, 2016

    @jmdobry
    jmdobry
    on Jul 28, 2016
    Member
    More actions

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

  7. hung101 commented on Jan 20, 2017

    @hung101
    hung101
    on Jan 20, 2017
    More actions

    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.

  8. hung101 commented on Jan 20, 2017

    @hung101
    hung101
    on Jan 20, 2017
    More actions

    I found the solution:

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

    must set the environment variable

    Reacted by Jason Dobry, Rashedul Islam Sagor, Aurélie Leportier, Nisar Khalid and Rajneesh Mitharwal
  9. jmdobry
    closed this as completedon Feb 8, 2017
  10. informaticosgb commented on Jul 21, 2017

    @informaticosgb
    informaticosgb
    on Jul 21, 2017
    More actions

    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);

    👍

    Reacted by Paul Makhnovskiy
  11. yoshi-automation
    added
    🚨This issue needs some love.
    triage meI really want to be triaged.
    on Apr 6, 2020
  12. ahrarmonsur
    added a commit that references this issue on Nov 8, 2022

    chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 (#…

    a62d10c
  13. ace-n
    added a commit that references this issue on Nov 10, 2022

    chore(deps): update dependency @google-cloud/nodejs-repo-tools to v3 (#…

    b901943
  14. NimJay
    added a commit that references this issue on Nov 10, 2022

    chore: udpate lint configs (#158)

    74518ad
  15. 4 remaining items

  16. ace-n
    added 2 commits that reference this issue on Nov 15, 2022

    refactor: use execSync for tests (#158)

    619f10f

    refactor: use execSync for tests (#158)

    9e6a526
  17. ahrarmonsur
    added 5 commits that reference this issue on Nov 16, 2022

    chore: release 1.1.0 (#158)

    ff420d6

    chore: release 1.1.0 (#158)

    34aabaf

    chore: release 1.1.0 (#158)

    1c88741

    chore: release 1.1.0 (#158)

    43969e8

    chore: release 1.1.0 (#158)

    b13f50c
  18. ace-n
    added 3 commits that reference this issue on Nov 17, 2022

    refactor: use execSync for tests (#158)

    5030725

    refactor: use execSync for tests (#158)

    9a44b56

    chore: release 1.1.0 (#158)

    fe497f6
  19. ahrarmonsur
    added a commit that references this issue on Nov 17, 2022

    refactor: use execSync for tests (#158)

    117cb6d
  20. pattishin
    added 2 commits that reference this issue on Nov 18, 2022

    chore: release 1.7.3 (#159)

    0efbbea

    chore: release 1.7.3 (#159)

    e5826ab
  21. jsimonweb
    added a commit that references this issue on Dec 12, 2022

    chore: bump to next dev version (GoogleCloudPlatform#158)

    e24ad03
  22. kweinmeister
    added a commit that references this issue on Jan 11, 2023

    chore(main): release 1.6.1 (#158)

    a705ca4
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

      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.