Skip to content
ecdsa.com
Microsoft.IdentityModel.Tokens (.NET).NET

Error message

IDX10205: Issuer validation failed. Issuer: 'https://sts.windows.net/

Also printed as

  • IDX10205: Issuer validation failed.
  • Bearer error="invalid_token", error_description="The issuer 'https://sts.windows.net/00000000-0000-0000-0000-000000000000/' is invalid"

The text continues with "Did not match: validationParameters.ValidIssuer: '…' or validationParameters.ValidIssuers: '…' or validationParameters.ConfigurationManager.CurrentConfiguration.Issuer: '…'". ASP.NET Core sends `error_description="The issuer '…' is invalid"`.

Microsoft.IdentityModel.Tokens (.NET) — SecurityTokenInvalidIssuerException

What it means

The token's `iss` is not equal to `ValidIssuer`, any entry of `ValidIssuers`, or the issuer from the downloaded OpenID configuration. The message prints the token's issuer and every value it was compared with. In Microsoft Entra ID the textbook case is a v1.0 token (`https://sts.windows.net/<tenant>/`) checked against the v2.0 issuer (`https://login.microsoftonline.com/<tenant>/v2.0`) or vice versa.

Why it happens

How to fix it

  1. 1.

    Fix the token version at the source

    Setting `requestedAccessTokenVersion` to 2 in the API's manifest makes Entra ID issue v2.0 tokens with the `login.microsoftonline.com/…/v2.0` issuer.

    json
    // App registration manifest of the API: issue v2.0 access tokens
    {
      "api": { "requestedAccessTokenVersion": 2 }
    }
  2. 2.

    Accept both issuers during a migration

    List both forms of your own tenant's issuer — never accept arbitrary issuers to make the error go away.

    csharp
    options.TokenValidationParameters = new TokenValidationParameters
    {
        ValidIssuers =
        [
            $"https://login.microsoftonline.com/{tenantId}/v2.0",
            $"https://sts.windows.net/{tenantId}/", // only while v1.0 tokens are still in circulation
        ],
    };

Related errors

Browse the full signature error database