-
Notifications
You must be signed in to change notification settings - Fork 314
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow google.auth.impersonated_credentials ability to domain-delegate #930
Comments
ok, here are two snippets. In the first one, i'm using for referenc, all that the |
@arithmetic1728 @silvolu Please take a look. |
I would not say this is "pretty specific use case", as it appears that domain-wide delegation is crucial for any successful server-to-server interaction with Google Workspace. I am trying to provision users, Gmail settings, and calendar events from another source (running in AWS) to Google Workspace, and it seems that this issue is preventing me from using workload identity federation at the moment. I have to try the method outlined in the gists above, but if it does not work, I have to scrap federation and just store the service account keys as secrets in AWS - not really thrilled by the prospect. It would be nice if the "does not seem possible" comment in #935 had some reasoning as to why, as the gists here seem to show that it IS possible? |
you can use a service account directly to access workspace apis without the two step process of actually using domain delegation. i'm using a svc account here directly for the groups api. In your case, you can use worklaod federation from aws and enable |
This is a really rare usecase but filing it for the record and api surface parity with golang.
in some usecases, i would like to impersonate a service account AND use that service account to assume the identity of a Google Workspace User (and then use some api on behalf of that user)
Currently
google.auth.impersonated_credentials
fulfils the first phase:user_1 --> impersonate(svc_account) --> access_resource (as svc_account)
the flow in the go snippet below goes one step further:
user1->impersonate(svc_account)-->domain_delgate(user2)->calendar_api (as user2)
note the
Subject
field which does the second step (its very briefly described here under theaddition claims
section)WIthout this built in capability, a customer would need to manually generate a JWT signed by
svc_account
where thesubect
field is theuser2
then send that to google, get the access_token back and embed that intostaticCredential
the other approach is to chain the impersonated_credential into another stand-alone class (outside of this library)...(which maybe a better way, considering)
its really convoluted and i'll cite a sample of this shortly.
The text was updated successfully, but these errors were encountered: