🌐
GitHub
github.com › google-github-actions › auth
GitHub - google-github-actions/auth: A GitHub Action for authenticating to Google Cloud. · GitHub
Workload Identity Federation is ... a long-lived credential and establishes a trust delegation relationship between a particular GitHub Actions workflow invocation and permissions on Google Cloud....
Starred by 1.3K users
Forked by 294 users
Languages   TypeScript 98.8% | JavaScript 1.2%
🌐
Firefly
firefly.ai › academy › setting-up-workload-identity-federation-between-github-actions-and-google-cloud-platform
Firefly | Setting Up Workload Identity Federation Between GitHub Actions and Google Cloud Platform
Workload Identity Federation, or WIF, is a way to authenticate non-GCP systems, such as GitHub Actions, GitLab CI/CD, Bitbucket Pipelines, and other third-party CI/CD tools, with Google Cloud services without using long-lived service account keys.
Discussions

Using GitHub Actions to authenticate to Google Workload Identity Federation for credentials to use in a Python script - Stack Overflow
TL;DR How to get and use credentials to interact with Google products in a Python script (using Workload Identity Federation and GitHub Actions). Code at the end of the post. I worked calluses into... More on stackoverflow.com
🌐 stackoverflow.com
SSH to GCP VM from GitHub Actions using Workload Identity Federation
I have documented a similar use case in chapter 2 of my PCSE book using this example. Have you tried this approach? https://github.com/google-github-actions/auth/blob/main/README.md More on reddit.com
🌐 r/googlecloud
4
4
December 18, 2024
Workload Identity Federation (WIF) is one such gem, enabling secure, keyless authentication
Thanks for sharing. The last part with recommendations for GCP caught my attention. If there are other suggestions from the broader community around WIF, we're always open to listening. More on reddit.com
🌐 r/googlecloud
32
48
May 13, 2025
Federated Workload Identity: Service Principal vs Managed Idenity for GitHub Actions
my take is: If I can make managed identity work and not have to deal with handling secrets I do it. SP's are fallback, and it annoys me when MS services (ahem, Fabric) use them. More on reddit.com
🌐 r/AZURE
29
12
August 23, 2025
🌐
Microsoft Learn
learn.microsoft.com › en-us › entra › workload-id › workload-identity-federation
Workload Identity Federation - Microsoft Entra Workload ID | Microsoft Learn
You use workload identity federation to configure a user-assigned managed identity or app registration in Microsoft Entra ID to trust tokens from an external identity provider (IdP), such as GitHub or Google.
🌐
GitHub
github.com › marketplace › actions › azure-ad-workload-identity-federation
Azure AD Workload Identity Federation - GitHub Marketplace
This GitHub action acquires access tokens (JWTs) for federated Azure AD workload identities that have configured GitHub as Open ID Connect (OIDC) credential provider.
🌐
Google Cloud
cloud.google.com › blog › products › identity-security › enabling-keyless-authentication-from-github-actions
Enabling keyless authentication from GitHub Actions | Google Cloud Blog
December 7, 2021 - Whereas a JSON service account key is either accessible or inaccessible, Workload Identity Federation can be configured to selectively allow authentication based on properties in the downstream OIDC tokens. For GitHub Actions, that means you can, for example, restrict authentication to certain repositories, usernames, branch names, or published claims.
🌐
Google
docs.cloud.google.com › iam › identity and access management (iam) › configure workload identity federation with deployment pipelines
Configure Workload Identity Federation with deployment pipelines | Identity and Access Management (IAM) | Google Cloud Documentation
After you configure a workload identity pool to trust your GitHub repository, you can let workflows in that repository use their GitHub OIDC token to obtain short-lived Google Cloud credentials. You don't need to make any configuration changes in your GitLab account. After you configure a workload identity pool to trust your GitLab group, you can enable Workload Identity Federation for individual CI/CD jobs.
🌐
GitHub
docs.github.com › en › actions › security-for-github-actions › security-hardening-your-deployments › configuring-openid-connect-in-google-cloud-platform
Configuring OpenID Connect in Google Cloud Platform - GitHub Docs
This guide gives an overview of how to configure GCP to trust GitHub's OIDC as a federated identity, and includes a workflow example for the google-github-actions/auth action that uses tokens to authenticate to GCP and access resources.
Find elsewhere
🌐
Microsoft Learn
learn.microsoft.com › en-us › azure › databricks › dev-tools › auth › provider-github
Enable workload identity federation for GitHub Actions - Azure Databricks | Microsoft Learn
January 16, 2026 - Subject claim: (Optional) The JWT claim that contains the workload identity (sub) value from the OIDC token. For GitHub, leave the field as sub, which encodes the repository, branch, tag, pull/merge request, or environment that triggered the workflow. For example, the following Databricks CLI command creates a federation policy for an organization named my-org and a Databricks service principal numeric ID of 5581763342009999:
🌐
GitHub
github.com › aip-dev › google.aip.dev › blob › master › aip › auth › 4117.md
External Account Credentials (Workload Identity Federation)
In order to use workload identity ... are needed to configure workload identity pools, providers, service account impersonation and generate the JSON configuration file to be used by the auth libraries....
Author   aip-dev
Top answer
1 of 1
1

Issue with Google Drive API Authentication using GitHub Actions

I created my workload identity pool according to the Google GitHub Actions Auth documentation without any service account. Then I tried to connect to Google Drive, which requires an OAuth 2.0 access token. I used the following configuration:

- name: Authenticate with Google Cloud
    uses: 'google-github-actions/auth@v2'
    with:
        project_id: 'my-project'
        workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'

- name: Upload files to Google Drive
    uses: 'Burak-Atak/drive-upload@master'
    with:
      google_credentials_file_path: ${{ env.GOOGLE_APPLICATION_CREDENTIALS }}
      files_to_create: "app.spec"
      drive_folder_id: "242fgdfg345345"
      files_to_update: "requirements.txt"
      file_ids_to_update: "asdas3534fdgg"

However, I got the following error with below code:

def authenticate_google(self):
    credentials, project_id = load_credentials_from_file(
        os.environ["GOOGLE_APPLICATION_CREDENTIALS"],
        scopes=[
            'https://www.googleapis.com/auth/drive.file',
            'https://www.googleapis.com/auth/drive',
            'https://www.googleapis.com/auth/drive.metadata'
        ]
    )

    return build("drive", "v3", credentials=credentials)
googleapiclient.errors.HttpError: <HttpError 401 when requesting https://www.googleapis.com/upload/drive/v3/files?fields=id&alt=json&uploadType=multipart returned "Request had invalid authentication credentials. Expected OAuth 2 access token, login cookie or other valid authentication credential. See https://developers.google.com/identity/sign-in/web/devconsole-project.". Details: "[{'message': 'Invalid Credentials', 'domain': 'global', 'reason': 'authError', 'location': 'Authorization', 'locationType': 'header'}]">

I realized I should use OAuth 2.0 for the Google Drive API. Then I changed my configuration to this:

- name: Authenticate with Google Cloud
  uses: google-github-actions/auth@v2
  with:
    workload_identity_provider: 'projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider'
    project_id: '<PROJECT_ID>'
    service_account: '<PROJECT_ID>@<PROJECT_ID>.iam.gserviceaccount.com'
    token_format: 'access_token'
    access_token_lifetime: '60s'
    access_token_scopes: 'https://www.googleapis.com/auth/drive.file,https://www.googleapis.com/auth/drive,https://www.googleapis.com/auth/drive.metadata'

- name: Upload files to Google Drive
    uses: 'Burak-Atak/drive-upload@master'
    with:
      google_credentials_file_path: ${{ env.GOOGLE_APPLICATION_CREDENTIALS }}
      files_to_create: "app.spec"
      drive_folder_id: "242fgdfg345345"
      files_to_update: "requirements.txt"
      file_ids_to_update: "asdas3534fdgg"

After this change, I started to get the following error even though I have the Service Account Token Creator and Owner roles in my service account:

google-github-actions/auth failed with: failed to generate Google Cloud OAuth 2.0 Access Token for <PROJECT_ID>@<PROJECT_ID>.iam.gserviceaccount.com: {
  "error": {
    "code": 403,
    "message": "Permission 'iam.serviceAccounts.getAccessToken' denied on resource (or it may not exist).",
    "status": "PERMISSION_DENIED",
    "details": [
      {
        "@type": "type.googleapis.com/google.rpc.ErrorInfo",
        "reason": "IAM_PERMISSION_DENIED",
        "domain": "iam.googleapis.com",
        "metadata": {
          "permission": "iam.serviceAccounts.getAccessToken"
        }
      }
    ]
  }
}

Solution

I figured out that I should add a service account to my workload pool. Check the "Connected service accounts" part in the Google Cloud Console. If there is no connected service account, you should add one.

🌐
GitHub
github.com › pfnet-research › gcp-workload-identity-federation-webhook
GitHub - pfnet-research/gcp-workload-identity-federation-webhook: This webhook is for mutating pods that will require GCP Workload Identity Federation access from Kubernetes Cluster.
This webhook is for mutating pods that will require GCP Workload Identity Federation access from Kubernetes Cluster. - pfnet-research/gcp-workload-identity-federation-webhook
Starred by 50 users
Forked by 15 users
Languages   Go 86.6% | Makefile 9.1% | Smarty 3.0% | Dockerfile 1.3% | Go 86.6% | Makefile 9.1% | Smarty 3.0% | Dockerfile 1.3%
🌐
Databricks
docs.databricks.com › local development tools › authentication › authenticate using oauth token federation › enable token federation for ci/cd › github actions
Enable workload identity federation for GitHub Actions | Databricks on AWS
January 16, 2026 - Subject claim: (Optional) The JWT claim that contains the workload identity (sub) value from the OIDC token. For GitHub, leave the field as sub, which encodes the repository, branch, tag, pull/merge request, or environment that triggered the workflow. For example, the following Databricks CLI command creates a federation policy for an organization named my-org and a Databricks service principal numeric ID of 5581763342009999:
🌐
OneUptime
oneuptime.com › home › blog › how to configure microsoft entra workload identity federation for github
How to Configure Microsoft Entra Workload Identity Federation for GitHub
February 16, 2026 - Create federated credentials on your existing app registration (you do not need a new one). Update your workflow to use the OIDC login method. Test in a non-production environment. Once confirmed working, remove the old client secret from the app registration and delete it from GitHub Secrets. The best part is you can have both authentication methods active during the transition period, so there is no downtime. Workload identity federation is one of those security improvements that also makes your life easier.
🌐
GitHub
github.com › salrashid123 › workload_federation_cloudrun_gcf
GitHub - salrashid123/workload_federation_cloudrun_gcf: Authenticating using Workload Identity Federation to Cloud Run, Cloud Functions · GitHub
Configure GCP Workload Identity with that OIDC provider · Deploy a Cloud Run application which requires Authentication. Use Workload Federation and IAM API to exchange the ambient OIDC token from step 1 for a Google-issued OIDC token
Author   salrashid123
🌐
GitHub
github.com › signalfx › gcp_workload_identity_federation
GitHub - signalfx/gcp_workload_identity_federation · GitHub
This repository provides tools to set up Workload Identity Federation in Google Cloud Platform (GCP) for granting access to Splunk integrations.
Starred by 2 users
Forked by 2 users
Languages   Python 53.8% | HCL 46.2%
🌐
Medium
mahendranp.medium.com › gcp-workload-identity-federation-with-github-actions-1d320f62417c
GCP: Enabling keyless authentication from GitHub Actions | by Mahendran | Medium
March 4, 2024 - Workload Identity Federation (WIF) is a pivotal method for utilizing an external authentication system to authorize access to Google Cloud Platform (GCP) resources such as AWS, Azure, GitHub or with any identity provider (IdP) that supports ...
🌐
GitHub
github.com › MicrosoftDocs › entra-docs › blob › main › docs › workload-id › workload-identity-federation.md
entra-docs/docs/workload-id/workload-identity-federation.md at main · MicrosoftDocs/entra-docs
Set up a user-assigned managed identity as a federated identity credential on an app registration. Read the workload identity overview to learn how to configure a Kubernetes workload to get an access token from Microsoft identity provider and ...
Author   MicrosoftDocs
🌐
DEV Community
dev.to › massimobonanni › azure-workload-identity-federation-and-github-actions-pf7
Azure Workload Identity Federation and GitHub Actions - DEV Community
May 2, 2023 - This approach was born to trust tokens from external identity provider, such as GitHub or Google (or other in the future). You first create a relationship between the identity (that can be a managed identity or an App registration) and the external identity provider. Once this relationship is created, every time the workload wants to authenticate itself against AzureAD, it retrieves a token from the external IdP and, uses it to request access token from AAD.