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

token expiration broken when using GCE service accounts #212

Closed
silvolu opened this issue Sep 16, 2014 · 1 comment · Fixed by #213
Closed

token expiration broken when using GCE service accounts #212

silvolu opened this issue Sep 16, 2014 · 1 comment · Fixed by #213
Assignees
Labels
🚨 This issue needs some love. triage me I really want to be triaged. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone

Comments

@silvolu
Copy link
Contributor

silvolu commented Sep 16, 2014

The access token expiration is computed using the value of the token_expires field of the token, but the access token returned by GCE service accounts doesn't contain such field, only expires_in.

@stephenplusplus stephenplusplus self-assigned this Sep 17, 2014
stephenplusplus added a commit to stephenplusplus/gcloud-node that referenced this issue Sep 17, 2014
A response from the GCE metadata server responds with data in a
different format from that of the GAPIToken() request. Instead of
looking for a property that doesn't exist `token_expires`, we now
calculate the expiration timestamp from `expires_in`.

For more, see [Authenticating from Google Compute Engine][auth].

[auth]:https://developers.google.com/compute/docs/authentication#applications

Fixes googleapis#212
stephenplusplus added a commit to stephenplusplus/gcloud-node that referenced this issue Sep 17, 2014
A response from the GCE metadata server responds with data in a
different format from that of the GAPIToken() request. Instead of
looking for a property that doesn't exist `token_expires`, we now
calculate the expiration timestamp from `expires_in`.

For more, see [Authenticating from Google Compute Engine][auth].

[auth]:https://developers.google.com/compute/docs/authentication#applications

Fixes googleapis#212
stephenplusplus added a commit to stephenplusplus/gcloud-node that referenced this issue Sep 17, 2014
A response from the GCE metadata server responds with data in a
different format from that of the GAPIToken() request. Instead of
looking for a property that doesn't exist `token_expires`, we now
calculate the expiration timestamp from `expires_in`.

For more, see [Authenticating from Google Compute Engine][auth].

[auth]:https://developers.google.com/compute/docs/authentication#applications

Fixes googleapis#212
stephenplusplus added a commit to stephenplusplus/gcloud-node that referenced this issue Sep 17, 2014
A response from the GCE metadata server responds with data in a
different format from that of the GAPIToken() request. Instead of
looking for a property that doesn't exist `token_expires`, we now
calculate the expiration timestamp from `expires_in`.

For more, see [Authenticating from Google Compute Engine][auth].

[auth]:https://developers.google.com/compute/docs/authentication#applications

Fixes googleapis#212
stephenplusplus added a commit to stephenplusplus/gcloud-node that referenced this issue Sep 17, 2014
A response from the GCE metadata server responds with data in a
different format from that of the GAPIToken() request. Instead of
looking for a property that doesn't exist `token_expires`, we now
calculate the expiration timestamp from `expires_in`.

For more, see [Authenticating from Google Compute Engine][auth].

[auth]:https://developers.google.com/compute/docs/authentication#applications

Fixes googleapis#212
@o-klp
Copy link

o-klp commented Sep 19, 2014

@jgeewax jgeewax added auth type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. labels Feb 2, 2015
@jgeewax jgeewax added this to the Core Stable milestone Feb 2, 2015
@yoshi-automation yoshi-automation added 🚨 This issue needs some love. triage me I really want to be triaged. labels Apr 6, 2020
sofisl pushed a commit that referenced this issue Nov 11, 2022
sofisl pushed a commit that referenced this issue Nov 11, 2022
This PR includes changes from googleapis/gapic-generator-typescript#317
that will move the asynchronous initialization and authentication from the client constructor
to an `initialize()` method. This method will be automatically called when the first RPC call
is performed.

The client library usage has not changed, there is no need to update any code.

If you want to make sure the client is authenticated _before_ the first RPC call, you can do
```js
await client.initialize();
```
manually before calling any client method.
sofisl pushed a commit that referenced this issue Nov 11, 2022
This PR was generated using Autosynth. 🌈

Synth log will be available here:
https://source.cloud.google.com/results/invocations/b205fd33-200c-4298-88b8-18b0d1c79a3e/targets

- [ ] To automatically regenerate this PR, check this box.
sofisl pushed a commit that referenced this issue Nov 11, 2022
sofisl pushed a commit that referenced this issue Nov 11, 2022
…andwritten libraries (#212)

- [ ] Regenerate this pull request now.

PiperOrigin-RevId: 429395631

Source-Link: googleapis/googleapis@84594b3

Source-Link: googleapis/googleapis-gen@ed74f97
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZWQ3NGY5NzBmZDgyOTE0ODc0ZTZiMjdiMDQ3NjNjZmE2NmJhZmU5YiJ9
sofisl pushed a commit that referenced this issue Nov 11, 2022
gcr.io/repo-automation-bots/owlbot-nodejs:latest@sha256:f93bb861d6f12574437bb9aee426b71eafd63b419669ff0ed029f4b7e7162e3f
sofisl pushed a commit that referenced this issue Nov 11, 2022
* chore(main): release 2.1.0

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Nov 11, 2022
PiperOrigin-RevId: 314792023

Source-Author: Google APIs <[email protected]>
Source-Date: Thu Jun 4 13:24:33 2020 -0700
Source-Repo: googleapis/googleapis
Source-Sha: 8070bcb140b06991a636d4ba7d665c5adab1675d
Source-Link: googleapis/googleapis@8070bcb

Co-authored-by: Justin Beckwith <[email protected]>
sofisl pushed a commit that referenced this issue Nov 11, 2022
…212)

PiperOrigin-RevId: 417856932
Source-Link: googleapis/googleapis@16ecf07
Source-Link: googleapis/googleapis-gen@d295521
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDI5NTUyMTliNjVmYjdmNDdmY2U5NmM5M2RmYmYyNWMyZmRlMWQ4MiJ9
See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md
Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Co-authored-by: Benjamin E. Coe <[email protected]>
sofisl pushed a commit that referenced this issue Jan 26, 2023
Fixes #1008
Source-Link: googleapis/synthtool@b0535a7
Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-nodejs:latest@sha256:bbb8dd6576ac58830a07fc17e9511ae898be44f2219d3344449b125df9854441

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
sofisl pushed a commit that referenced this issue Sep 13, 2023
* updated CHANGELOG.md [ci skip]

* updated package.json [ci skip]

* updated samples/package.json [ci skip]
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. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants