wiaudit

GitHub immutable OIDC subject and Azure federated credentials

What changed: for repositories created, renamed or transferred on or after 2026‑07‑15, GitHub Actions OIDC tokens carry an immutable subject that includes numeric IDs:

old:  repo:my-org/my-repo:ref:refs/heads/main
new:  repo:my-org@5544123/my-repo@821093847:ref:refs/heads/main

Microsoft recommends migrating federated identity credentials to this format. Credentials written in the old, name-based format do not match tokens from such repositories, and azure/login fails with AADSTS700213.

Why it is safer: a name-based subject follows the name. If a repository is deleted or renamed and someone else registers the same name, a name-based credential trusts them. IDs are never reused.

Find the IDs

gh api repos/my-org/my-repo --jq '"owner_id=\(.owner.id) repo_id=\(.id)"'

or let wiaudit do it for every repository your tenant trusts:

wiaudit collect azure  -o azure-snapshot.json --all-subscriptions
wiaudit collect github --from-azure azure-snapshot.json -o repos.json
wiaudit scan --azure azure-snapshot.json --github repos.json

Rule WIA001 lists every name-based credential and suggests the exact immutable subject. wiaudit doctor shows which format a specific workflow will send.

Migrate a credential

az ad app federated-credential create --id <APP_ID> --parameters '{
  "name": "main-immutable",
  "issuer": "https://token.actions.githubusercontent.com",
  "subject": "repo:my-org@5544123/my-repo@821093847:ref:refs/heads/main",
  "audiences": ["api://AzureADTokenExchange"]
}'

Keep the old credential until a workflow run succeeds, then delete it. Mind the limit of 20 federated credentials per app or managed identity.


Made by the authors of wiaudit (open source, Apache-2.0).