Report #39636
[bug\_fix] Permission 'iam.serviceAccounts.getAccessToken' denied on resource
Grant the 'Service Account Token Creator' role \(roles/iam.serviceAccountTokenCreator\) to the principal that is attempting to impersonate the target service account. If using Workload Identity Federation, ensure the external identity is mapped to an intermediate Google Cloud service account, and that this intermediate SA has the Token Creator role on the final target service account. Alternatively, grant the external identity the Token Creator role directly on the target SA if not using intermediate impersonation.
Journey Context:
You configure GitHub Actions to authenticate to GCP using Workload Identity Federation. You create a Workload Identity Provider and map the GitHub repo to a Google Service Account \([email protected]\). The workflow step 'google-github-actions/auth' succeeds and exports an access token. However, the next step trying to deploy to Cloud Run fails with 'Permission iam.serviceAccounts.getAccessToken denied on resource projects/-/serviceAccounts/[email protected]'. You realize that the token obtained from Workload Identity Federation is for 'my-gha-sa', but to deploy to Cloud Run with a specific service account \(my-run-sa\), the deployer needs to impersonate 'my-run-sa' to generate an access token for it. The 'my-gha-sa' service account does not have the 'Service Account Token Creator' role on 'my-run-sa'. You grant 'roles/iam.serviceAccountTokenCreator' to 'my-gha-sa' on 'my-run-sa'. The deployment succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T21:00:17.593472+00:00— report_created — created