Interview Prep/GitHub Actions/OIDC & Cloud Authentication

`An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Incorrect token audience`

IntermediateTroubleshootingOIDC & Cloud Authentication
Answer

Likely causes → The OIDC provider's client ID list does not include the token's aud (default sts.amazonaws.com for the AWS action), or a custom audience input was set.

Diagnose →

aws iam get-open-id-connect-provider --open-id-connect-provider-arn arn:aws:iam::111122223333:oidc-provider/token.actions.githubusercontent.com

Fix → aws iam add-client-id-to-open-id-connect-provider --client-id sts.amazonaws.com --open-id-connect-provider-arn ... or align the audience input.

Prevent → Keep the default audience unless you have a reason.

All GitHub Actions questions Roadmap: GitHub Actions

More on OIDC & Cloud Authentication