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 — feat: allow set lifetime for service account creds by arithmetic1728 · Pull Request #516 · googleapis/google-auth-library-java

This repository was archived by the owner on May 12, 2026. It is now read-only.

Conversation

@arithmetic1728

@arithmetic1728 arithmetic1728 commented Dec 10, 2020

Copy link
Copy Markdown
Contributor

Fixes #474 for service account credentials.

For self-signed JWT, this doc explains the constraints on exp claim in the assertion.

The exp (expiration time) claim must be no more than 12 hours in the future. 
If you are calling a Google API, the exp claim must be set no more than 1 hour in the future.

This PR removes the hard-coded 1 hour lifetime, allows users to provide a custom lifetime up to 12 hours.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@arithmetic1728
feat: allow set lifetime for service account creds
235523f
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Dec 10, 2020
@codecov

codecov Bot commented Dec 10, 2020 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Codecov Report

Merging #516 (6ed887a) into master (af21727) will increase coverage by 0.08%.
The diff coverage is 88.23%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #516      +/-   ##
============================================
+ Coverage     80.05%   80.13%   +0.08%     
- Complexity      421      424       +3     
============================================
  Files            28       28              
  Lines          1965     1978      +13     
  Branches        209      212       +3     
============================================
+ Hits           1573     1585      +12     
  Misses          283      283              
- Partials        109      110       +1     
Impacted Files Coverage Δ Complexity Δ
.../google/auth/oauth2/ServiceAccountCredentials.java 82.94% <88.23%> (+0.49%) 52.00 <6.00> (+3.00)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update af21727...6ed887a. Read the comment docs.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arithmetic1728

arithmetic1728 commented Dec 10, 2020

Copy link
Copy Markdown
Contributor Author

The format / format-code failure is not related to this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@arithmetic1728
arithmetic1728 marked this pull request as ready for review December 10, 2020 07:18
@arithmetic1728
arithmetic1728 requested review from a team and silvolu December 10, 2020 07:18
elharo
elharo reviewed Dec 10, 2020
View reviewed changes
Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

arithmetic1728 and others added 2 commits December 10, 2020 12:42
@arithmetic1728
update
de79320
@arithmetic1728
Merge branch 'master' into lifespan_srv
282e791
silvolu
silvolu reviewed Dec 14, 2020
View reviewed changes
Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

@arithmetic1728
arithmetic1728 requested a review from chingor13 December 14, 2020 19:47
@arithmetic1728
update name
37c39f4
chingor13
chingor13 suggested changes Dec 16, 2020
View reviewed changes
Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

chingor13
chingor13 suggested changes Dec 16, 2020
View reviewed changes
Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

arithmetic1728 added 3 commits December 16, 2020 14:49
@arithmetic1728
update
0419d60
@arithmetic1728
update
727aad7
@arithmetic1728
change lifetime 0 to default
1a1330a
@arithmetic1728

arithmetic1728 commented Dec 16, 2020

Copy link
Copy Markdown
Contributor Author

Just did a new commit to use the default lifetime (3600) if lifetime is set to 0.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chingor13
chingor13 suggested changes Dec 17, 2020
View reviewed changes
Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread oauth2_http/javatests/com/google/auth/oauth2/ServiceAccountCredentialsTest.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread oauth2_http/java/com/google/auth/oauth2/ServiceAccountCredentials.java Resolved

Uh oh!

There was an error while loading. Please reload this page.

arithmetic1728 and others added 4 commits December 17, 2020 10:55
@arithmetic1728
Merge branch 'master' into lifespan_srv
afd2a40
@arithmetic1728
update
6154d90
@arithmetic1728
update
39476f1
@arithmetic1728
Merge branch 'master' into lifespan_srv
28ad538
chingor13
chingor13 approved these changes Jan 12, 2021
View reviewed changes
@chingor13
Merge branch 'master' into lifespan_srv
6ed887a
@chingor13
chingor13 merged commit 427f2d5 into master Jan 12, 2021
@chingor13
chingor13 deleted the lifespan_srv branch January 12, 2021 23:12
gcf-merge-on-green Bot pushed a commit that referenced this pull request Jan 26, 2021
@release-please
chore: release 0.23.0 (#525)
c76766e
🤖 I have created a release \*beep\* \*boop\* 
---
## [0.23.0](https://www.github.com/googleapis/google-auth-library-java/compare/v0.22.2...v0.23.0) (2021-01-26)


### ⚠ BREAKING CHANGES

* privatize deprecated constructor (#473)

### Features

* allow custom lifespan for impersonated creds ([#515](https://www.github.com/googleapis/google-auth-library-java/issues/515)) ([0707ed4](https://www.github.com/googleapis/google-auth-library-java/commit/0707ed4bbb40fb775f196004ee30f8c695fe662b))
* allow custom scopes for compute engine creds ([#514](https://www.github.com/googleapis/google-auth-library-java/issues/514)) ([edc8d6e](https://www.github.com/googleapis/google-auth-library-java/commit/edc8d6e0e7ca2c6749d026ba42854a09c4879fd6))
* allow set lifetime for service account creds ([#516](https://www.github.com/googleapis/google-auth-library-java/issues/516)) ([427f2d5](https://www.github.com/googleapis/google-auth-library-java/commit/427f2d5610f0e8184a21b24531d2549a68c0b546))
* promote IdToken and JWT features ([#538](https://www.github.com/googleapis/google-auth-library-java/issues/538)) ([b514fe0](https://www.github.com/googleapis/google-auth-library-java/commit/b514fe0cebe5a294e0cf97b7b5349e6a523dc7b2))


### Bug Fixes

* per google style, logger is lower case ([#529](https://www.github.com/googleapis/google-auth-library-java/issues/529)) ([ecfc6a2](https://www.github.com/googleapis/google-auth-library-java/commit/ecfc6a2ea6060e06629b5d422b23b842b917f55e))
* privatize deprecated constructor ([#473](https://www.github.com/googleapis/google-auth-library-java/issues/473)) ([5804ff0](https://www.github.com/googleapis/google-auth-library-java/commit/5804ff03a531268831ac797ab262638a3119c14f))
* remove deprecated methods ([#537](https://www.github.com/googleapis/google-auth-library-java/issues/537)) ([427963e](https://www.github.com/googleapis/google-auth-library-java/commit/427963e04702d8b73eca5ed555539b11bbe97342))
* replace non-precondition use of Preconditions ([#539](https://www.github.com/googleapis/google-auth-library-java/issues/539)) ([f2ab4f1](https://www.github.com/googleapis/google-auth-library-java/commit/f2ab4f14262d54de0fde85494cfd92cf01a30cbe))
* switch to GSON ([#531](https://www.github.com/googleapis/google-auth-library-java/issues/531)) ([1b98d5c](https://www.github.com/googleapis/google-auth-library-java/commit/1b98d5c86fc5e56187c977e7f43c39bb62483d40))
* use default timeout if given 0 for ImpersonatedCredentials ([#527](https://www.github.com/googleapis/google-auth-library-java/issues/527)) ([ec74870](https://www.github.com/googleapis/google-auth-library-java/commit/ec74870c372a33d4157b45bb5d59ad7464fb2238))


### Dependencies

* update dependency com.google.appengine:appengine-api-1.0-sdk to v1.9.84 ([#422](https://www.github.com/googleapis/google-auth-library-java/issues/422)) ([b262c45](https://www.github.com/googleapis/google-auth-library-java/commit/b262c4587b058e6837429ee05f1b6a63620ee598))
* update dependency com.google.guava:guava to v30.1-android ([#522](https://www.github.com/googleapis/google-auth-library-java/issues/522)) ([4090d1c](https://www.github.com/googleapis/google-auth-library-java/commit/4090d1cb50041bceb1cd975d1a9249a412df936f))


### Documentation

* fix wording in jwtWithClaims Javadoc ([#536](https://www.github.com/googleapis/google-auth-library-java/issues/536)) ([af21727](https://www.github.com/googleapis/google-auth-library-java/commit/af21727815263fb5ffc07ede953cf042fac3ac2b))
---


This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
@release-please release-please Bot mentioned this pull request Jan 4, 2022
chore(main): release google-auth-library-java 1.0.0 #819
Closed
@release-please release-please Bot mentioned this pull request Aug 11, 2022
chore(main): release 1.11.0 #974
Merged
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

3 more reviewers
@silvolu silvolu silvolu left review comments
@elharo elharo elharo left review comments
@chingor13 chingor13 chingor13 approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Support for generating a OAuth 2.0 access tokens with lifespan > 1 hour

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@arithmetic1728 @chingor13 @silvolu @elharo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.