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

Failed login with OIDC provider since v3 upgrade "Could not load credentials from any providers" #858

Open
casstait-vgw opened this issue Sep 19, 2023 · 6 comments
Labels
bug Something isn't working p2

Comments

@casstait-vgw
Copy link

casstait-vgw commented Sep 19, 2023

Describe the bug

Currently use this action at v2 with success using an OIDC provider to authenticate.

Would heartily like to upgrade this action however attempts of upgrading to v3 and v4 are not successful. Can successfully authenticate with the assumed role as shown below however cannot continue as met with an error.

268841466-c4502f12-c208-4b90-8d49-18c336918a65

Expected Behavior

Expect successful login using OIDC as we can with v2 of this action.

Current Behavior

Successful authentication with assumed role using OIDC but credentials unable to be loaded for the action.

Reproduction Steps

Current workflow snippet

on:
  schedule:
    - cron: '30 22 * * 0'
  workflow_dispatch:

permissions:
  contents: read
  id-token: write
  pull-requests: write

jobs:
  job-name:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4

      - name: Configure AWS Credentials
        uses: aws-actions/configure-aws-credentials@v4
        with:
          role-to-assume:  'arn:aws:iam::xxx:role/dev-github-actions-read'
          aws-region: 'eu-west-1'
          mask-aws-account-id: 'no'

IAM trust relationship on role

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Federated": "arn:aws:iam::xxxx:oidc-provider/token.actions.githubusercontent.com"
            },
            "Action": "sts:AssumeRoleWithWebIdentity",
            "Condition": {
                "ForAnyValue:StringLike": {
                    "token.actions.githubusercontent.com:sub": [
                        "repo:<org>/<repo>:environment:<env>",
                        "repo:<org>/<repo>:ref:refs/heads/main",
                        "repo:<org>/<repo>:ref:refs/tags/*",
                        "repo:<org>/<repo>:pull_request"
                    ]
                }
            }
        }
    ]
}

Possible Solution

No response

Additional Information/Context

No response

@casstait-vgw casstait-vgw added bug Something isn't working needs-triage This issue still needs to be triaged labels Sep 19, 2023
@yasminetalby yasminetalby self-assigned this Sep 19, 2023
@yasminetalby yasminetalby added in-progress This issue is being actively worked on and removed needs-triage This issue still needs to be triaged labels Sep 21, 2023
@agoose77
Copy link

I'm also seeing this over at Awkward Array: https://github.com/scikit-hep/awkward/actions/runs/6302675659/job/17110771652?pr=2721

Does anyone have any ideas what's causing the regression?

moustafab added a commit to getditto/configure-aws-profile-action that referenced this issue Oct 23, 2023
zr3 added a commit to zr3/rust-roguelike that referenced this issue Jan 7, 2024
zr3 added a commit to zr3/rust-roguelike that referenced this issue Jan 7, 2024
@chalbersma
Copy link

Did you ever see a fix for this?

@chalbersma
Copy link

It's working in production for us now: https://github.com/scikit-hep/awkward/blob/217b3ea531004ef800d76908f5030447a78f6bbd/.github/workflows/docs.yml#L358-L373

Thanks! I thought I was experiencing an error that might have been the same as this; but it ended up being a PEBCAK error.

@casstait-vgw
Copy link
Author

This is still showing the same behaviour in our workflow unfortunately.

@Inmovilizame
Copy link

Inmovilizame commented May 16, 2024

Happening to our company too. Weird behaviour is that we have the same OIDC setup (managed though terraform) in various accounts, one of them is working correctly and other 2 shows this behaviour.

      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v3
        with:
          role-to-assume: ${{ secrets[steps.aws_role_name.outputs.rolename] }}
          role-session-name: "deploy_coach_${{github.event.inputs.environment}}"
          aws-region: ${{ env.STATE_REGION }}
image
      - name: Configure AWS credentials
        uses: aws-actions/configure-aws-credentials@v3
        with:
          role-to-assume: ${{ secrets[steps.aws_role_name.outputs.rolename] }}
          role-session-name: "deploy_coach_${{github.event.inputs.environment}}"
          aws-region: ${{ env.STATE_REGION }}
image

@tim-finnigan tim-finnigan added p2 and removed in-progress This issue is being actively worked on labels Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p2
Projects
None yet
Development

No branches or pull requests

6 participants