Skip to content

Support resolving credentials through Google ADC #39

@freddd

Description

@freddd

Is your feature request related to a problem? Please describe.
When running locally and being authenticated using gcloud or in GKE/GCE/Cloud Run, etc on GCP I would expect the library to pick up the credentials automatically using Google ADC. I'd be super happy with just having it check for GOOGLE_APPLICATION_CREDENTIALS or gcloud auth as a first step.

Describe the solution you'd like
Google Application Default Credentials does the following checks:

  1. Checks if the environment variable GOOGLE_APPLICATION_CREDENTIALS is set. If it's set it should be a path pointing to a json credentials file for a service account
  2. Checks if you are authenticated using gcloud by checking:
    • %APPDATA%/gcloud/application_default_credentials.json on Windows
    • $HOME/.config/gcloud/application_default_credentials.json on Linux/OSX
  3. Checks if you are running on GKE/GCE/AppEngine/Cloud Functions/Cloud Run.

An example of how it's done in the auth library provided by Google in Go: https://github.com/golang/oauth2/blob/f6687ab2804cbebdfdeef385bee94918b1ce83de/google/default.go#L111

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions