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

Issue with auth and Docker GCE VM instance #815

Closed
ryanseys opened this issue Aug 19, 2015 · 7 comments
Closed

Issue with auth and Docker GCE VM instance #815

ryanseys opened this issue Aug 19, 2015 · 7 comments
Assignees

Comments

@ryanseys
Copy link
Contributor

From an internal bug report:

--- SNIP ---

I tried to use gcloud-node from a Node application running inside of a docker container on a GCE container-optimized VM instance. I expected authentication to work automatically given the README (https://github.com/GoogleCloudPlatform/gcloud-node#on-google-compute-engine) but it didn't work.

What did you expect to happen?
gcloud-node should work inside docker containers on GCE container-optimized VM instances (or the README should be updated to specify cases in which authentication doesn't work automatically on GCE)

--- SNIP ---

@stephenplusplus
Copy link
Contributor

Thanks for sharing! Is there a time stamp when that was filed? Also would be great to get the reporter here for further questions.

All that should be required in GCE is a project ID. If this is managed VMs, authentication is manual. It's been a while since I've dug into this though, perhaps things have changed. I'll try to look into this soon.

@ryanseys
Copy link
Contributor Author

Oh you're right, time of file was Dec 1, 2014 :( This might be obsolete.

@stephenplusplus stephenplusplus self-assigned this Sep 1, 2015
@stephenplusplus
Copy link
Contributor

I've learned a few things while digging into this. I used a new GCE vm with all scopes enabled.

  1. We have a bug with how we instantiate Datastore (PR coming soon) fixed
  2. From GCE, getting a bearer token from the google auth library is successful
  3. Making requests to the Storage API works
  4. Making requests to the Datastore API does not work

Here's my app: http://130.211.180.58:8080/

Here's a detailed view of the failed Datastore API request.

var query = dataset.createQuery(["Users"])
dataset.runQuery(query, function() {...});

Which makes the request:

{ method: 'POST',
  uri: 'https://www.googleapis.com/datastore/v1beta2/datasets/nth-circlet-705/runQuery',
  headers:
   { 'Content-Type': 'application/x-protobuf',
     Authorization: 'Bearer ya29....', // same token that works with Storage calls
     'User-Agent': 'gcloud-node/0.20.0',
     'Content-Length': 13 } }

And responds with:

{ statusCode: 401,
  body: undefined,
  headers:
   { vary: 'X-Origin, Origin,Accept-Encoding',
     'www-authenticate': 'Bearer realm="https://accounts.google.com/", error=invalid_token',
     'content-type': 'text/html; charset=UTF-8',
     date: 'Wed, 02 Sep 2015 17:50:38 GMT',
     expires: 'Wed, 02 Sep 2015 17:50:38 GMT',
     'cache-control': 'private, max-age=0',
     'x-content-type-options': 'nosniff',
     'x-frame-options': 'SAMEORIGIN',
     'x-xss-protection': '1; mode=block',
     server: 'GSE',
     'alternate-protocol': '443:quic,p=1',
     'alt-svc': 'quic=":443"; p="1"; ma=604800',
     'accept-ranges': 'none',
     connection: 'close' }

// @jgeewax not sure where to go from here.

@stephenplusplus stephenplusplus removed their assignment Nov 12, 2015
@stephenplusplus
Copy link
Contributor

From @jonparrott (thanks!):

cloud-platform doesn't include userinfo.email. userinfo.email was just recently added to the default scopes for [managed VMs] but it will be a few weeks before it hits prod. In the meantime, add the scopes to your app.yaml like this: https://github.com/GoogleCloudPlatform/nodejs-getting-started/blob/2-structured-data/app.yaml

@theacodes
Copy link

Should be in production now, verified last week. :)

@theacodes
Copy link

Actually, this only applies for MVMs. GCE instances will still need to explicitly request userinfo.email until datastore v1beta3. example

@stephenplusplus
Copy link
Contributor

Sweet, thanks for the info!

sofisl pushed a commit that referenced this issue Nov 10, 2022
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [uuid](https://github.com/uuidjs/uuid) | [`^8.0.0` -> `^9.0.0`](https://renovatebot.com/diffs/npm/uuid/8.3.2/9.0.0) | [![age](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/compatibility-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/npm/uuid/9.0.0/confidence-slim/8.3.2)](https://docs.renovatebot.com/merge-confidence/) |

---

### Configuration

📅 **Schedule**: Branch creation - "after 9am and before 3pm" (UTC), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, click this checkbox. ⚠ **Warning**: custom changes will be lost.

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/nodejs-translate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzMi4xOTQuMiIsInVwZGF0ZWRJblZlciI6IjMyLjE5NC4yIn0=-->
sofisl pushed a commit that referenced this issue Jan 17, 2023
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/4895db2c-aba9-406e-b81d-1e2251ee464c/targets

- [ ] To automatically regenerate this PR, check this box.

PiperOrigin-RevId: 325949033
Source-Link: googleapis/googleapis@94006b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants