Skip to content

Service account: Cannot set user to impersonate using GoogleCredential fromStream #1007

@WilsonGiese

Description

@WilsonGiese

I'm trying to use a service account to automatically manage/create groups using the Directory API. When I try to use a service account with the credentials in the form of JSON and try to use the GoogleCredential.fromStream(...) call, there does not seem to be a way to set the user, and at least for the Admin API I cannot get calls to work without impersonating a user as I always get Forbidden (403) responses.

Using the GoogleCredential Builder seems to work fine with the PKCS12 formatted key as long as I set the user, but your docs and console seem to recommend to use the JSON formatted credential file.

Have I missed something, or is this functionality not available without using the builder?

Metadata

Metadata

Assignees

Labels

type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions