IDX10204: Unable to validate issuer. validationParameters.ValidIssuer is null or whitespace AND validationParameters.ValidIssuers is null or empty.
means the API checks the issuer but was never told which issuer to accept. Set
ValidIssuer in TokenValidationParameters to the value your tokens
carry in iss, and the check passes with validation still on.
Watch out for the response text: the client is told
The issuer 'https://issuer.test' is invalid, naming the token's correct issuer.
The token is fine; the API's configuration is missing a value, and only the log says so.
https://issuer.test, fix11-api, the ports and the projects
api2 and mint2 are the test's own.
The error
$token = .\mint2\bin\Debug\net10.0\Mint.exe "fix11-test-only-signing-key-0123456789abcdef" https://issuer.test fix11-api 30
curl.exe -i http://127.0.0.1:15602/patients -H "Authorization: Bearer $token"
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Sat, 14 Nov 2026 01:26:32 GMT
Server: Kestrel
WWW-Authenticate: Bearer error="invalid_token", error_description="The issuer 'https://issuer.test' is invalid"
The server console:
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[1]
Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidIssuerException: IDX10204: Unable to validate issuer. validationParameters.ValidIssuer is null or whitespace AND validationParameters.ValidIssuers is null or empty.
...
Why it happens
The instance on port 15602 was started with --Lab:NoIssuer=true, which skips the
line that sets ValidIssuer. Nothing in its Program.cs sets
ValidateIssuer to false or sets an Authority, and the log line names
both settings it found empty: ValidIssuer and ValidIssuers. The same token, sent to an instance that has the value, got
a 200 (below), so the token's iss was never the problem.
If your ValidIssuer is read from configuration, check that its key exists in the
environment that fails; printing the value at start-up shows whether it arrived. Where to look: the response header
carries the misleading description, and the IDX10204 line with the real reason is in the
server console at Information level for Microsoft.AspNetCore.Authentication.
The fix
The lines from the test's Program.cs that set the issuer:
...
if (builder.Configuration["Lab:NoIssuer"] != "true")
{
parameters.ValidIssuer = "https://issuer.test";
}
...
The same token against the instance where that line ran (port 15600):
curl.exe -i http://127.0.0.1:15600/patients -H "Authorization: Bearer $token"
HTTP/1.1 200 OK
...
["Maria Garcia","David Chen"]
Setting ValidateIssuer = false would switch the issuer check off: whatever
the token says in iss would no longer be compared with anything. That is the
cost, so it is not the fix, and it was not run here.
How it was reproduced
A copy of the batch's first API project (made with dotnet new web -f net10.0) with Microsoft.AspNetCore.Authentication.JwtBearer
10.0.15 (Microsoft.IdentityModel 8.19.2), one endpoint protected with
RequireAuthorization(), on 127.0.0.1:15602 without a valid issuer and on 15600
with it, ASP.NET Core 10.0.15 runtime, SDK 11.0.100. The token came from a copy of a console project made with dotnet new console, on
System.IdentityModel.Tokens.Jwt 8.19.2 with a made-up test key; requests went through curl
8.22.0 on Windows.
Frequently asked
- What does IDX10204 ValidIssuer is null or whitespace mean?
- The API validates the issuer but has no ValidIssuer or ValidIssuers value. In the test the API was started without the line that sets ValidIssuer.
- Why does ASP.NET Core say my correct issuer is invalid?
- Because the API has no issuer to compare with. In the test the response named the token's correct issuer, while the server log said IDX10204: ValidIssuer is null or whitespace.
- Should I set ValidateIssuer to false to fix IDX10204?
- No. That switches the issuer check off instead of giving it a value. In the test, setting ValidIssuer to the token's issuer turned the 401 into a 200.
More decoded errors in the Fixes category. When the value is set but differs from the token's, the log says IDX10205 instead.