-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support ADC for Google Workspace (dwd/no-dwd) #240
Merged
austingebauer
merged 2 commits into
hashicorp:main
from
pgsgeo:torfjor/google-application-default-credentials
Jul 3, 2023
Merged
Support ADC for Google Workspace (dwd/no-dwd) #240
austingebauer
merged 2 commits into
hashicorp:main
from
pgsgeo:torfjor/google-application-default-credentials
Jul 3, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This commit adds support for authenticating to the Google Workspace Directory API through [Application Default Credentials](https://cloud.google.com/docs/authentication/application-default-credentials). ADC is assumed if `ServiceAccount` is left empty. Authentication can be performed through domain-wide delegation of authority by impersonating a workspace user, or directly by granting the service account the necessary admin roles. See the [docs](https://cloud.google.com/identity/docs/how-to/setup#auth-no-dwd) for authenticating as a service account without domain-wide delegation of authority. This commit introduces a new config field, `ImpersonatePrincipal`. This field is used as a target service account to create a signed JWT for the Workspace user to impersonate. This is useful in a scenario where you are doing ADC with [External Account Credentials](https://google.aip.dev/auth/4117) but still need to impersonate a Workspace user through DWDoA. Since you don't have access to the service account's private key, you need an extra hop to the Service Account Credentials API to generate the signed JWT.
Thanks, @torfjor! I'm having a look at this. Would you mind opening a PR for the documentation on the Vault repo? Thanks! |
Thanks, @torfjor |
austingebauer
approved these changes
Jul 3, 2023
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. Thanks, @torfjor!
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
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.
Overview
This commit adds support for authenticating to the Google Workspace Directory API through Application Default Credentials. ADC is assumed if
ServiceAccount
is left empty.Authentication can be performed through domain-wide delegation of authority by impersonating a workspace user, or directly by granting the service account the necessary admin roles.
See the docs for authenticating as a service account without domain-wide delegation of authority.
This commit introduces a new config field,
ImpersonatePrincipal
. This field is used as a target service account to create a signed JWT for the Workspace user to impersonate. This is useful in a scenario where you are doing ADC with External Account Credentials but still need to impersonate a Workspace user through DWDoA. Since you don't have access to the service account's private key, you need an extra hop to the Service Account Credentials API to generate the signed JWT.Related Issues/Pull Requests
Contributor Checklist
Docs commit