Skip to content

Commit 8b63db5

Browse files
committed
update workforce user project conditional
1 parent 1ea2cd1 commit 8b63db5

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

google/cloud/internal/oauth2_external_account_credentials.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ StatusOr<AccessToken> ExternalAccountCredentials::GetToken(
198198
// Workforce Identity is handled at the org level and requires the userProject
199199
// header. Workload Identity is handled at the project level and doesn't
200200
// require the header.
201-
if (info_.IsWorkforceIdentityFederation()) {
201+
if (info_.IsWorkforceIdentityFederation() &&
202+
info_.workforce_pool_user_project.has_value()) {
202203
form_data.emplace_back(
203204
"options", absl::StrCat(R"({"userProject": ")",
204205
*info_.workforce_pool_user_project, R"("})"));

0 commit comments

Comments
 (0)