Repository navigation
Create gcloud-node client that uses metadata service auth #511
Description
Activity
Can you try with master? We recently went through an overhaul of how we authenticate, but it hasn't had a release yet.
Thanks Stephen, it looks like the version in master is working on GCE with the metadata auth approach.
Follow-up question:
How have you been testing the GCE support locally (i.e., outside of GCE)? Do you simulate the GCE metadata service?For my testing, I actually pushed to a GCE endpoint. But fortunately, with our upcoming release, we have removed most of our auth code and instead use the google-auth-library. They have many unit tests that make sure the right requests are made for auth tokens and such.
I'm glad to hear master solves the problem, and sorry for the confusion with the current release. We should be getting a new release out soon.
- addedtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
on May 14, 2015 - added 6 commits that reference this issue
on Aug 22, 2022 33 remaining items
- added a commit that references this issue
on Feb 4, 2026 - added a commit that references this issue
on Feb 5, 2026 - added a commit that references this issue
on Feb 23, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Feb 26, 2026 - added a commit that references this issue
on Mar 18, 2026 - added 2 commits that reference this issue
on Mar 23, 2026 - added a commit that references this issue
on Mar 27, 2026 - added a commit that references this issue
on May 5, 2026
How can I force the gcloud-node client to attempt to use the compute engine environment, which relies upon the "metadata service" for getting auth tokens?
I see this chunk of code in lib/storage/index.js, and I don't see where/how it is checking for the compute engine environment:
Basically I'm attempting to create my client like this:
And I'm hitting an error because I haven't passed a config object with credentials. The docs here made it seem like this was the expected syntax on compute engine however (i.e.,
gcloud.storage()).Is this auth approach supported currently?