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 — fix: service account impersonation with workforce credentials by lsirac · Pull Request #770 · googleapis/google-auth-library-java

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

Conversation

@lsirac

@lsirac lsirac commented Oct 13, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

While service account impersonation is not commonly used with workforce
pool configurations, there is a bug where the workforcePoolUserProject is not being set on the source credential.

This also lets us align with other languages who added the workforcePoolUserProject to the base class, instead of IdentityPoolCredentials (though it is the only one that currently supports it).

The bug itself is fixed by the refactor. By moving workforcePoolUserProject to be set in the base constructor, it is set before initializeImpersonatedCredentials() is called. A copy of the source credential is then made that has the workforcePoolUserProject set. Prior to this it was not set and the impersonation call resulted in a 403.

Sorry, something went wrong.

Uh oh!

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

All reactions
@lsirac
fix: service account impersonation with workforce credentials
7644961
@lsirac
lsirac requested a review from a team October 13, 2021 22:38
@google-cla google-cla Bot added the cla: yes This human has signed the Contributor License Agreement. label Oct 13, 2021
lsirac added 2 commits October 13, 2021 16:08
@lsirac
fix: add old constructors
b965516
@lsirac
fix: add one test for service account impersonation with a workforce …
08a3358
…IdentityPoolCredential
@lsirac
lsirac requested review from Neenu1995, TimurSadykov and chingor13 October 14, 2021 00:33
TimurSadykov
TimurSadykov reviewed Oct 19, 2021
View reviewed changes

@TimurSadykov TimurSadykov left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some general comments for now. Can you please highlight the bugfix itself? Otherwise refactoring hides it

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentials.java Resolved

Uh oh!

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

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

Uh oh!

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

@lsirac
fix: code review
de396ee
@lsirac
lsirac requested a review from TimurSadykov October 19, 2021 03:05
TimurSadykov
TimurSadykov suggested changes Oct 19, 2021
View reviewed changes

@TimurSadykov TimurSadykov left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, couple small comments

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread oauth2_http/java/com/google/auth/oauth2/IdentityPoolCredentials.java Resolved

Uh oh!

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

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

Uh oh!

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

@lsirac
fix: remove workforce methods from IdentityPoolCredentials
6e82536
@lsirac
lsirac requested a review from TimurSadykov October 20, 2021 00:06
TimurSadykov
TimurSadykov approved these changes Oct 20, 2021
View reviewed changes

@TimurSadykov TimurSadykov left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry, something went wrong.

Uh oh!

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

All reactions
lsirac and others added 2 commits October 19, 2021 22:29
@lsirac
fix: can't remove setWorkforcePoolUserProject in Builder
1368cdd
@lsirac
Merge branch 'main' into sa_wf
f95b997
Neenu1995
Neenu1995 approved these changes Oct 20, 2021
View reviewed changes
lsirac added 3 commits October 21, 2021 10:34
@lsirac
Merge branch 'main' into sa_wf
bce8c94
@lsirac
Merge branch 'main' into sa_wf
eda4da4
@lsirac
Merge branch 'main' into sa_wf
8eb4226
@chanseokoh chanseokoh added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 21, 2021
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Oct 21, 2021
@lsirac
lsirac merged commit 6449ef0 into googleapis:main Oct 21, 2021
@lsirac
lsirac deleted the sa_wf branch October 21, 2021 18:29
gcf-merge-on-green Bot pushed a commit that referenced this pull request Nov 10, 2021
@release-please
chore: release 1.3.0 (#777)
714efeb
🤖 I have created a release \*beep\* \*boop\*
---
## [1.3.0](https://www.github.com/googleapis/google-auth-library-java/compare/v1.2.2...v1.3.0) (2021-11-10)


### Features

* next release from main branch is 1.3.0 ([#780](https://www.github.com/googleapis/google-auth-library-java/issues/780)) ([1149581](https://www.github.com/googleapis/google-auth-library-java/commit/1149581e63267e3553c74ba2114d849c5b24f27b))


### Bug Fixes

* **java:** java 17 dependency arguments ([#1266](https://www.github.com/googleapis/google-auth-library-java/issues/1266)) ([#779](https://www.github.com/googleapis/google-auth-library-java/issues/779)) ([9160a53](https://www.github.com/googleapis/google-auth-library-java/commit/9160a53e6507c1c938795e181c65ad80db1bcf11))
* service account impersonation with workforce credentials ([#770](https://www.github.com/googleapis/google-auth-library-java/issues/770)) ([6449ef0](https://www.github.com/googleapis/google-auth-library-java/commit/6449ef0922053121a6732933ab9e246965fde3b7))
---


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

@chingor13 chingor13 Awaiting requested review from chingor13
2 more reviewers
@TimurSadykov TimurSadykov TimurSadykov approved these changes
@Neenu1995 Neenu1995 Neenu1995 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.

Uh oh!

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

5 participants

@lsirac @TimurSadykov @Neenu1995 @chanseokoh @kokoro-team
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.