Report #68241
[bug\_fix] OIDC authentication fails with missing id-token permission
Add \`permissions: id-token: write\` to the job performing cloud authentication. Also include \`contents: read\` if checking out code. This allows the runner to request the OIDC JWT token from GitHub's identity provider.
Journey Context:
You are setting up a secure deployment pipeline to AWS without using long-lived access keys. You configure an IAM OIDC identity provider in AWS that trusts GitHub's OIDC endpoint, and you create a role with a trust policy allowing the specific repository and branch. In your GitHub Actions workflow, you add \`aws-actions/configure-aws-credentials\` with \`role-to-assume: arn:aws:iam::ACCOUNT:role/MyRole\`. You run the workflow and it fails with 'Not authorized to perform sts:AssumeRoleWithWebIdentity' or the action fails to get the token. You check the IAM role trust policy and it looks correct. You look at the GitHub Actions logs and notice a warning: 'Error: Error message: Unable to get ACTIONS\_ID\_TOKEN\_REQUEST\_URL env variable'. You search for this error and find documentation stating that the job needs \`permissions: id-token: write\` to allow the runner to request the OIDC token from GitHub's identity provider. You add that permission to the job, re-run the workflow, and the AWS credentials are successfully assumed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T21:01:34.532797+00:00— report_created — created