Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Workload Identity Federation #1342

Open
moricho opened this issue Feb 17, 2025 · 1 comment
Open

Add support for Workload Identity Federation #1342

moricho opened this issue Feb 17, 2025 · 1 comment
Labels
auth Issues related to the auth library priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@moricho
Copy link

moricho commented Feb 17, 2025

Background

Currently, the auth library supports three authentication methods:

  • User credentials (authorized_user)
  • Service account key credentials (service_account)
  • Metadata service credentials (for GCE/GKE)

However, it lacks support for Workload Identity Federation, which is Google Cloud's recommended way to access Google Cloud resources from non-Google Cloud environments (Github Actions, AWS, Azure, etc.) without using service account keys.

Proposed Changes

Add support for Workload Identity Federation by:

  1. Implementing external account credentials:

    • Add support for type: "external_account" in ADC files
    • Implement STS (Security Token Service) token exchange
    • Support credential source configurations for different providers
  2. Supporting some providers:

    • Generic OIDC provider
    • AWS
    • Azure

Example Configuration

{
    "type": "external_account",
    "audience": "//iam.googleapis.com/projects/PROJECT_NUMBER/locations/global/workloadIdentityPools/POOL_ID/providers/PROVIDER_ID",
    "subject_token_type": "urn:ietf:params:oauth:token-type:jwt",
    "token_url":"https://sts.googleapis.com/v1/token",
    "credential_source": {
        "url": "***",
        "headers": {"Authorization":"***"},
        "format":{"type":"json","subject_token_field_name":"value"}
    },
    "service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/***:generateAccessToken"
}
@moricho moricho added priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Feb 17, 2025
@coryan coryan added the auth Issues related to the auth library label Feb 17, 2025
@coryan
Copy link
Contributor

coryan commented Feb 17, 2025

However, it lacks support for Workload Identity Federation, which is Google Cloud's recommended way to access Google Cloud resources from non-Google Cloud environments (Github Actions, AWS, Azure, etc.) without using service account keys.

We are aware and it is part of our roadmap. Unfortunately, we are not at liberty of sharing timelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auth Issues related to the auth library priority: p3 Desirable enhancement or fix. May not be included in next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

2 participants