dex icon indicating copy to clipboard operation
dex copied to clipboard

Google Connector: support Application Default Credential (ADC)

Open chr-b opened this issue 2 years ago • 2 comments

Preflight Checklist

  • [X] I agree to follow the Code of Conduct that this project adheres to.
  • [X] I have searched the issue tracker for an issue that matches the one I want to file, without success.

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

chr-b avatar Aug 10 '22 11:08 chr-b

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

nabokihms avatar Aug 10 '22 11:08 nabokihms

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

mariadb-ChristianBauer avatar Sep 22 '22 12:09 mariadb-ChristianBauer

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

nabokihms avatar Jan 21 '23 22:01 nabokihms