`AADSTS70021: No matching federated identity record found for presented assertion. Assertion Issuer: 'https://token.actions.githubusercontent.com'. Assertion Subject: 'repo:devopsshack/shack-api:environment:prod'.`
IntermediateTroubleshootingOIDC & Cloud Authentication
Answer
Likely causes → The Entra federated credential subject differs (configured for ref:refs/heads/main but the job uses an environment), wrong issuer or audience.
Diagnose → The error prints the actual subject; compare with:
az ad app federated-credential list --id $APP_ID -o table
Fix → Add a federated credential with subject repo:devopsshack/shack-api:environment:prod.
Prevent → Create one federated credential per environment in IaC.
More on OIDC & Cloud Authentication
`Error: Could not assume role with OIDC: Not authorized to perform sts:AssumeRoleWithWebIdentity`Advanced`Error: Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers`Intermediate`Error: Unable to get ACTIONS_ID_TOKEN_REQUEST_URL env variable`BeginnerOIDC works on `main` but fails on a tag-triggered release workflow.Intermediate`An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Incorrect token audience`Intermediate`No OpenIDConnect provider found in your account for https://token.actions.githubusercontent.com`Beginner