dexidp / dex

OpenID Connect (OIDC) identity and OAuth 2.0 provider with pluggable connectors
https://dexidp.io
Apache License 2.0
9.31k stars 1.68k forks source link

Google Connector: support Application Default Credential (ADC) #2626

Closed chr-b closed 1 year ago

chr-b commented 2 years ago

Preflight Checklist

Problem Description

The Google provider documentation for fetching groups requires the parameter serviceAccountFilePath.

When DEX is running on GCP, there is no need to export a GCP service account credential and make it available as serviceAccountFilePath. In fact, it is bad security practice to generate long-term credentials such as GCP service account user-managed keys.

Proposed Solution

If no serviceAccountFilePath is provided, obtain the Application Default Credential (ADC) from the environment.

See https://pkg.go.dev/cloud.google.com/go#hdr-Authentication_and_Authorization

Alternatives Considered

No response

Additional Information

To my understanding, the adminEmail is also no longer needed either. You can have the GCP service account access the GSuite directory API directly, without having to impersonate another user: https://support.google.com/a/answer/162106#zippy=%2Cset-up-domain-wide-delegation-for-a-client

nabokihms commented 2 years ago

Related https://github.com/dexidp/dex/pull/2530

mariadb-ChristianBauer commented 1 year ago

Yes, this can be closed as the feature was shipped with the v2.34.0 release.

nabokihms commented 1 year ago

I am closing the issue. Feel free to reopen it or open a new one if something is left to implement.