google / google/oauth2l

impersonate service account and type jwt does not seem to work well together

Open
#165 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
737
Forks
95
Avg merge
10h 38m
Merged PRs (30d)
2

Description

I'm trying something similar to:
```
oauth2l fetch --refresh --impersonate-service-account='xxxyyy@gke-accounts.iam.gserviceaccount.com' --type jwt --audience="https://google.com"
```
And I see the following error:

```
google: could not parse JSON key: google: read JWT from JSON credentials: 'type' field is "authorized_user" (expected "service_account")
```

It seems like no impersonated credentials are used in the JWT code path.

What I would like is the impersonated identity token (Patching JWTTokenSource with https://pkg.go.dev/google.golang.org/api/impersonate#IDTokenSource seems to give me what I'm looking for)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.