{
  "schema_version": "1.1.0",
  "record_type": "citation-evidence-pack",
  "pack_id": "entra-federated-credential-debugger",
  "title": "Entra issuer, subject, and audience comparison examples",
  "description": "Reproduce a matching GitHub branch credential, an environment-versus-branch mismatch, and an AKS issuer missing its final slash.",
  "scope": "These synthetic claims compare standard credentials by exact issuer, subject, and audience values. They contain no signed OIDC token. For a live exchange, Entra also checks the token signature and the configuration on the target application or managed identity.",
  "canonical_url": "https://encrypt-online.com/evidence/entra-federated-credential-debugger.json",
  "tool": {
    "id": "entra-federated-credential-debugger",
    "name": "Entra Federated Credential Debugger",
    "path": "/tools/entra-federated-credential-debugger",
    "canonical_url": "https://encrypt-online.com/tools/entra-federated-credential-debugger"
  },
  "implementation": {
    "version": "source-sha256:4adf4668d2615952",
    "aggregate_sha256": "4adf4668d26159526c92c1377f2931de145fc5765205fade2db68a2260d127d0",
    "sources": [
      {
        "path": "lib/entra-federation-core.mjs",
        "sha256": "623992abf98c8c85ee40cddec9c172cfee0ded6f85eb66715a606d884ee25bbe"
      },
      {
        "path": "data/azure-citation-evidence.mjs",
        "sha256": "f63d508caf1daf4dadd40500821ad560ca8a7c221d5af274bbf1c644fd5455e4"
      },
      {
        "path": "scripts/azure-citation-evidence-adapters.mjs",
        "sha256": "71636408282eba9f886cfe8ad63bccf0e8db7c46357f10e57a35cc463abe8c71"
      }
    ]
  },
  "verification": {
    "last_verified": "2026-10-20",
    "command": "npm run check:citation-evidence",
    "environments": [
      "Node.js release check with Web Crypto",
      "Chromium desktop 1440x900 evidence presentation"
    ]
  },
  "standards": [
    {
      "name": "Microsoft federated identity credential configuration",
      "section": "Issuer, subject, audience, and GitHub entity types",
      "url": "https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-create-trust"
    },
    {
      "name": "Microsoft federation considerations",
      "section": "Exact credential matching and propagation",
      "url": "https://learn.microsoft.com/en-us/entra/workload-id/workload-identity-federation-considerations"
    },
    {
      "name": "Azure Workload Identity troubleshooting",
      "section": "AADSTS70021 and the AKS issuer trailing slash",
      "url": "https://azure.github.io/azure-workload-identity/docs/troubleshooting.html#aadsts70021-no-matching-federated-identity-record-found-for-presented-assertion"
    }
  ],
  "cases": [
    {
      "case_id": "ENTRA-GITHUB-BRANCH-MATCH-001",
      "classification": "valid",
      "symptom": "A GitHub main-branch assertion has the issuer, subject, and audience configured on the branch credential.",
      "safe_input": {
        "tokenInput": "{\n  \"iss\": \"https://token.actions.githubusercontent.com\",\n  \"sub\": \"repo:example/project:ref:refs/heads/main\",\n  \"aud\": \"api://AzureADTokenExchange\"\n}",
        "credentialInput": "{\n  \"name\": \"github-main\",\n  \"issuer\": \"https://token.actions.githubusercontent.com\",\n  \"subject\": \"repo:example/project:ref:refs/heads/main\",\n  \"audiences\": [\"api://AzureADTokenExchange\"]\n}",
        "now": 1792497600000
      },
      "expected_output": {
        "match": true,
        "matches": {
          "issuer": true,
          "subject": true,
          "audience": true
        },
        "mismatch_fields": [],
        "signature_checked": false
      },
      "failure_code": null,
      "expected_outcome": "All three values match this branch credential. If a live exchange fails, check the target application, credential propagation, and assertion signature.",
      "fixture_sha256": "2ba3cfbe46571715a7b708203b9c4d68ea4ac2a9c17a8cedfe287f17a3ffa18e",
      "example": {
        "title": "A matching GitHub branch credential",
        "steps": [
          "Paste Claims JSON into OIDC token or claims JSON.",
          "Paste Credential JSON into Federated credential JSON.",
          "Select Compare credentials and read the issuer, subject, and audience results."
        ],
        "values": [
          {
            "label": "Claims JSON",
            "value": "{\n  \"iss\": \"https://token.actions.githubusercontent.com\",\n  \"sub\": \"repo:example/project:ref:refs/heads/main\",\n  \"aud\": \"api://AzureADTokenExchange\"\n}"
          },
          {
            "label": "Credential JSON",
            "value": "{\n  \"name\": \"github-main\",\n  \"issuer\": \"https://token.actions.githubusercontent.com\",\n  \"subject\": \"repo:example/project:ref:refs/heads/main\",\n  \"audiences\": [\"api://AzureADTokenExchange\"]\n}"
          },
          {
            "label": "Issuer matches",
            "value": "true"
          },
          {
            "label": "Subject matches",
            "value": "true"
          },
          {
            "label": "Audience matches",
            "value": "true"
          }
        ]
      }
    },
    {
      "case_id": "ENTRA-GITHUB-ENVIRONMENT-MISMATCH-002",
      "classification": "mismatch",
      "symptom": "A GitHub Production environment assertion is compared with a main-branch credential.",
      "safe_input": {
        "tokenInput": "{\n  \"iss\": \"https://token.actions.githubusercontent.com\",\n  \"sub\": \"repo:example/project:environment:Production\",\n  \"aud\": \"api://AzureADTokenExchange\"\n}",
        "credentialInput": "{\n  \"name\": \"github-main\",\n  \"issuer\": \"https://token.actions.githubusercontent.com\",\n  \"subject\": \"repo:example/project:ref:refs/heads/main\",\n  \"audiences\": [\"api://AzureADTokenExchange\"]\n}",
        "now": 1792497600000
      },
      "expected_output": {
        "match": false,
        "matches": {
          "issuer": true,
          "subject": false,
          "audience": true
        },
        "mismatch_fields": [
          "subject"
        ],
        "signature_checked": false
      },
      "failure_code": "ENTRA_SUBJECT_MISMATCH",
      "expected_outcome": "The environment subject differs from the branch subject. Select or configure the credential for the intended workflow environment.",
      "fixture_sha256": "e6c191c92569a1c6e580cca41ea5b0842ba5596e02a02a42ea0472a78bfc53cb",
      "example": {
        "title": "An environment subject differs from a branch",
        "steps": [
          "Paste Claims JSON into OIDC token or claims JSON.",
          "Paste Credential JSON into Federated credential JSON.",
          "Select Compare credentials and read the issuer, subject, and audience results."
        ],
        "values": [
          {
            "label": "Claims JSON",
            "value": "{\n  \"iss\": \"https://token.actions.githubusercontent.com\",\n  \"sub\": \"repo:example/project:environment:Production\",\n  \"aud\": \"api://AzureADTokenExchange\"\n}"
          },
          {
            "label": "Credential JSON",
            "value": "{\n  \"name\": \"github-main\",\n  \"issuer\": \"https://token.actions.githubusercontent.com\",\n  \"subject\": \"repo:example/project:ref:refs/heads/main\",\n  \"audiences\": [\"api://AzureADTokenExchange\"]\n}"
          },
          {
            "label": "Issuer matches",
            "value": "true"
          },
          {
            "label": "Subject matches",
            "value": "false"
          },
          {
            "label": "Audience matches",
            "value": "true"
          }
        ]
      }
    },
    {
      "case_id": "ENTRA-AKS-ISSUER-SLASH-003",
      "classification": "mismatch",
      "symptom": "An AKS assertion issuer ends with a slash, but the credential issuer omits it.",
      "safe_input": {
        "tokenInput": "{\n  \"iss\": \"https://eastus.oic.prod-aks.azure.com/example-tenant/example-cluster/\",\n  \"sub\": \"system:serviceaccount:payments:invoice-api\",\n  \"aud\": \"api://AzureADTokenExchange\"\n}",
        "credentialInput": "{\n  \"name\": \"aks-invoice-api\",\n  \"issuer\": \"https://eastus.oic.prod-aks.azure.com/example-tenant/example-cluster\",\n  \"subject\": \"system:serviceaccount:payments:invoice-api\",\n  \"audiences\": [\"api://AzureADTokenExchange\"]\n}",
        "now": 1792497600000
      },
      "expected_output": {
        "match": false,
        "matches": {
          "issuer": false,
          "subject": true,
          "audience": true
        },
        "mismatch_fields": [
          "issuer"
        ],
        "signature_checked": false
      },
      "failure_code": "ENTRA_ISSUER_MISMATCH",
      "expected_outcome": "Copy the exact cluster issuer into the credential, including its final slash. The Kubernetes subject and audience already match in this example.",
      "fixture_sha256": "bbfc1c55507aead8d6bb9f27f2475af95fa68760f2f3278fbeef3b3f2ea50232",
      "example": {
        "title": "An AKS issuer needs its final slash",
        "steps": [
          "Paste Claims JSON into OIDC token or claims JSON.",
          "Paste Credential JSON into Federated credential JSON.",
          "Select Compare credentials and read the issuer, subject, and audience results."
        ],
        "values": [
          {
            "label": "Claims JSON",
            "value": "{\n  \"iss\": \"https://eastus.oic.prod-aks.azure.com/example-tenant/example-cluster/\",\n  \"sub\": \"system:serviceaccount:payments:invoice-api\",\n  \"aud\": \"api://AzureADTokenExchange\"\n}"
          },
          {
            "label": "Credential JSON",
            "value": "{\n  \"name\": \"aks-invoice-api\",\n  \"issuer\": \"https://eastus.oic.prod-aks.azure.com/example-tenant/example-cluster\",\n  \"subject\": \"system:serviceaccount:payments:invoice-api\",\n  \"audiences\": [\"api://AzureADTokenExchange\"]\n}"
          },
          {
            "label": "Issuer matches",
            "value": "false"
          },
          {
            "label": "Subject matches",
            "value": "true"
          },
          {
            "label": "Audience matches",
            "value": "true"
          }
        ]
      }
    }
  ]
}
