feat: [Google connector] use Cloud Identity API for fetching groups #4169
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.
A new Google connector option,
useCloudIdentityApi
, has been introduced.If the value is
true
, dex will use cloud identity api to fetchgroups. In particular, no user impersonation happens. The logic to
obtain the credentials is based on Application Default Credentials.
Alternatively, the user is allowed to pass a path to a credentials JSON
file using
serviceAccountFilePath
. In both cases, the principallinked to the credentials requires group read rights. In case
of a Service Account, a custom admin role with this right need to be
created in Google Workspace, and the Service Account needs to be
assigned to this role.
Moreover, Workload Identity Federation is supported as Application Default
Credentials supports this use case. Make sure to include
Service Account Token Creator
for the linked service account in thatcase.
Overview
What this PR does / why we need it
Until now, user impersonation was required to fetch groups for a certain user. In this PR, the user is allowed to opt-in for using cloud identity api which doesn't require user impersonation. Moreover, as Application Default Credentials are being used, Workload Identity Federation is supported with this PR, allowing interactions with Google Services from external sources, e.g. AWS, without requiring to provide any sensitive credential data on the caller side, c.f. here.
Special notes for your reviewer
Does this PR introduce a user-facing change?