Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Servers, nginx and Docker

configure-aws-credentials says no OpenID Connect provider exists for GitHub

ErrorNo OpenIDConnect provider found in your account for https://token.actions.githubusercontent.com

Short answer

AWS has no IAM identity provider for GitHub's token issuer in the account that holds the role. Create an OpenID Connect provider with the URL https://token.actions.githubusercontent.com and the audience sts.amazonaws.com in that same account, or fix a provider that was made in another account or with a wrong URL.

  • Applies to GitHub Actions, aws-actions/configure-aws-credentials, AWS CLI v2
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    List the OIDC providers in the AWS account that owns the role your workflow assumes. Compare the list with the account ID inside role-to-assume.

    aws sts get-caller-identity
    aws iam list-open-id-connect-providers
  2. 2Match what you see, then jump to its fix

    1. 1The list has no entry ending in token.actions.githubusercontent.comThe GitHub identity provider was never created in the accountFix
    2. 2The provider exists, but in another account than the one in role-to-assumeThe provider lives in a different AWS account than the roleFix
    3. 3A provider exists, but its URL is different from the issuer, for example a typo, a port or a pathThe provider was created with a wrong URL or audienceFix

What does the error look like?

  • No OpenIDConnect provider found in your account for https://token.actions.githubusercontent.com

Cause 1 of 3

The GitHub identity provider was never created in the account

1Check

The provider is an IAM entity. It has to exist once per account before any role can trust it.

aws iam list-open-id-connect-providers

2Fix

Create the provider with GitHub's issuer URL and the audience sts.amazonaws.com, which is the audience for the official action. The thumbprint list is optional, because IAM uses its trusted CA library.

aws iam create-open-id-connect-provider \
  --url https://token.actions.githubusercontent.com \
  --client-id-list sts.amazonaws.com

3Verify

The new provider is listed.

aws iam list-open-id-connect-providers

Confirmed by docs.github.com

Did this fix it?

Cause 2 of 3

The provider lives in a different AWS account than the role

1Check

An OIDC provider used in a role trust policy must be in the same account as the role. Compare the account ID in the role ARN with the one from get-caller-identity.

aws sts get-caller-identity --query Account --output text
echo "<role-arn-from-workflow>"

2Fix

Create the provider in the account that owns the role, and point the trust policy's Federated principal at that account's provider ARN.

"Principal": {
  "Federated": "arn:aws:iam::<account-id>:oidc-provider/token.actions.githubusercontent.com"
}

3Verify

Re-run the failed job from the Actions tab and watch the credentials step.

aws iam list-open-id-connect-providers

Confirmed by docs.aws.amazon.com

Did this fix it?

Cause 3 of 3

The provider was created with a wrong URL or audience

1Check

The URL is case-sensitive, must start with https://, and should not contain a port number. The audience must match what the workflow sends: sts.amazonaws.com with the official action.

aws iam list-open-id-connect-providers
aws iam get-open-id-connect-provider --open-id-connect-provider-arn <provider-arn>

2Fix

Delete the wrong provider and create it again with the exact URL and audience. Also make sure the job asks for the token.

permissions:
  id-token: write
  contents: read

3Verify

Run the workflow and watch the configure credentials step pass.

aws iam get-open-id-connect-provider --open-id-connect-provider-arn <provider-arn>

Confirmed by docs.aws.amazon.com

Did this fix it?

How do I stop it coming back?

  • Create the GitHub OIDC provider in your infrastructure code, once per AWS account.
  • Limit the role's trust policy with the :sub condition, so only your repositories and branches can assume it.
  • Keep id-token: write at job level where possible; it only lets the job request a token, not change resources.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Servers

Apache has a certificate, but https:// does not open

No line with :443 in the output of ss -ltnp

HTTPS needs four things at once: mod_ssl loaded, Apache listening on 443, a virtual host on 443 with SSLEngine on, and a firewall that lets 443 in.

4 causes, each with a fix

Servers

AWS CLI says you must specify a region

You must specify a region. You can also configure your region by running "aws configure".

The AWS CLI sends every request to one region and has none to use.

4 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.