IDX10208: Unable to validate audience. validationParameters.ValidAudience is null or whitespace and validationParameters.ValidAudiences is null.
means the API checks the audience but has no audience to accept. Set
ValidAudience in TokenValidationParameters to the name your tokens
carry in aud, and the check passes with validation still on.
The response misleads in the same way as its issuer twin: the client reads
The audience 'fix11-api' is invalid, which is the token's correct audience. The
missing piece is in the API's configuration, and only the server log names it.
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:15603/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 audience 'fix11-api' is invalid"
The server console:
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[1]
Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenInvalidAudienceException: IDX10208: Unable to validate audience. validationParameters.ValidAudience is null or whitespace and validationParameters.ValidAudiences is null.
...
Why it happens
The instance on port 15603 was started with --Lab:NoAudience=true, which skips the
line that sets ValidAudience. The test never set ValidateAudience to
false, so the audience was still checked, against nothing. The token itself carried
aud: fix11-api, and the same token got a 200 from the instance that has the value.
If your ValidAudience comes 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 IDX10208 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 audience:
...
if (builder.Configuration["Lab:NoAudience"] != "true")
{
parameters.ValidAudience = "fix11-api";
}
...
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"]
ValidateAudience = false would also remove this 401, by not comparing the
token's aud with anything: a token issued for another API with the same signing
key would then pass this check. That is what it costs, 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:15603 without a valid audience 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 IDX10208 ValidAudience is null or whitespace mean?
- The API validates the audience but has no ValidAudience or ValidAudiences value. In the test the API was started without the line that sets ValidAudience.
- Why does ASP.NET Core say my correct audience is invalid?
- Because it has no audience to compare with. In the test the response named the token's own audience, fix11-api, and the server log said IDX10208.
- Should I set ValidateAudience to false to fix IDX10208?
- No. That stops comparing the token's aud with anything. In the test, setting ValidAudience to the token's audience turned the 401 into a 200.
More decoded errors in the Fixes category. When the API has a value and the token's differs, the log says IDX10214; the issuer version of this post is IDX10204.