Bearer error="invalid_token", error_description="The signature is invalid", with IDX10511: Signature validation failed. Keys tried: ... in the log, means the API found the key the token's kid names, and that key did not verify the signature. In this test the kid was right and the key material behind it was not: the token was signed with different bytes under the same id. Put the same key under that id on both sides.

In the same lab, an unknown kid with another key (kid k2, IDX10503) and a token without a kid signed with another key (IDX10517) both got "The signature key was not found" instead; those two runs are in this post's evidence. The key ids k1 and k2, 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 "another-test-only-key-of-fix11-9876543210" https://issuer.test fix11-api 30 kid=k1
curl.exe -i http://127.0.0.1:15601/patients -H "Authorization: Bearer $token"
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Sat, 14 Nov 2026 01:26:30 GMT
Server: Kestrel
WWW-Authenticate: Bearer error="invalid_token", error_description="The signature is invalid"

The server console:

info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[1]
      Failed to validate the token.
      Microsoft.IdentityModel.Tokens.SecurityTokenInvalidSignatureException: IDX10511: Signature validation failed. Keys tried: 'Microsoft.IdentityModel.Tokens.SymmetricSecurityKey, KeyId: 'k1', InternalId: 'wldrSr-NT4zj4T2YRUezFgnI1w9IN6-u0IYtILAcPWU'. , KeyId: k1\r\n'.
Number of keys in TokenValidationParameters: '1'.
Number of keys in Configuration: '0'.
Matched key was in 'TokenValidationParameters'.
kid: 'k1'.
...

Why it happens

The API's only key has the id k1. The token maker also wrote kid: k1 into the token header but signed with another made-up string. The log says so in two lines: Matched key was in 'TokenValidationParameters' (the kid was found) and kid: 'k1', followed by the failure.

In this test the id matched and the key bytes did not, so the place to look is the key value each side reads, not the id. Compare the two values by length and by their first and last few characters rather than printing a whole key into a log. The short description is in the response header; the IDX10511 line with the kid and the keys tried is in the server console.

The fix

The API's key and id, from the test's Program.cs (started with --Lab:Kid=k1):

...
        var key = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(builder.Configuration["Jwt:Key"]!));
        if (builder.Configuration["Lab:Kid"] is string kid)
        {
            key.KeyId = kid;
        }
...

A token signed with the same key bytes under the same id:

$token = .\mint2\bin\Debug\net10.0\Mint.exe "fix11-test-only-signing-key-0123456789abcdef" https://issuer.test fix11-api 30 kid=k1
curl.exe -i http://127.0.0.1:15601/patients -H "Authorization: Bearer $token"
HTTP/1.1 200 OK
...
["Maria Garcia","David Chen"]

Advice, not tested here: when you change a signing key, give the new key a new id as well, so that the kid in a log line tells you which key a token was made with.

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:15601 with its key id set to k1, ASP.NET Core 10.0.15 runtime, SDK 11.0.100. Tokens came from a copy of a console project made with dotnet new console, on System.IdentityModel.Tokens.Jwt 8.19.2 with an optional kid= argument; both keys are made-up test strings. Requests went through curl 8.22.0 on Windows.

Frequently asked

What does IDX10511 Signature validation failed. Keys tried mean?
The API found a key with the token's kid and that key did not verify the signature. In the test the kid was k1 on both sides and the token was signed with a different key string.
Why does ASP.NET Core say 'The signature is invalid'?
In the test this was the response when the kid matched a configured key and the signature did not verify. In the same lab, an unknown kid or no kid, each with another key, got The signature key was not found instead.
How do I fix 'The signature is invalid' for a JWT?
Sign with the same key bytes the API holds under that kid. In the test a token signed with the API's key and kid k1 got a 200.

More decoded errors in the Fixes category. An unknown kid gives IDX10503 instead.