Bearer error="invalid_token", error_description="The signature key was not found"
is what an ASP.NET Core API sends back in the WWW-Authenticate header when the
token was signed with a key the API does not have. The server log names it
IDX10517. Sign the token and validate it with the same key and the request goes
through.
The fix is on whichever side holds the wrong key: the token issuer and the API's
IssuerSigningKey must be built from the same bytes. In the test below the token
maker used one made-up string and the API another; switching the token maker to the API's
key turned the 401 into a 200.
The error
The response, as curl.exe -i printed it (the body is empty):
$token = .\mint\bin\Debug\net10.0\Mint.exe "another-test-only-key-of-fix11-9876543210" https://issuer.test fix11-api 30 0
curl.exe -i http://127.0.0.1:15600/patients -H "Authorization: Bearer $token"
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Sat, 14 Nov 2026 01:13:01 GMT
Server: Kestrel
WWW-Authenticate: Bearer error="invalid_token", error_description="The signature key was not found"
The server console, at Information level for Microsoft.AspNetCore.Authentication:
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[1]
Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenSignatureKeyNotFoundException: IDX10517: Signature validation failed. The token's kid is missing. Keys tried: 'Microsoft.IdentityModel.Tokens.SymmetricSecurityKey, KeyId: '', InternalId: 'wldrSr-NT4zj4T2YRUezFgnI1w9IN6-u0IYtILAcPWU'. , KeyId: \r\n'.
Number of keys in TokenValidationParameters: '1'.
Number of keys in Configuration: '0'.
Exceptions caught:
'[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'.
token: '[PII of type 'Microsoft.IdentityModel.JsonWebTokens.JsonWebToken' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]'. See https://aka.ms/IDX10503 for details.
...
Why it happens
The token carries an HMAC signature made with the issuer's key. The API recomputes the
signature with the key in TokenValidationParameters and the two do not match.
Because this token has no kid (key id) header, the message says "The token's
kid is missing" and lists the one key it tried; the response header reduces all of that to
"The signature key was not found". The log line ends with a link to the IDX10503 page.
Note the two places the message appears. The client only ever sees the short
error_description; the IDX code and the list of keys tried are in the server
console. When you debug a 401 from a client, read the server log first.
The fix
The API's key, from appsettings.json and Program.cs of the test (a made-up string):
"Jwt": {
"Key": "fix11-test-only-signing-key-0123456789abcdef"
},
...
parameters.IssuerSigningKey = new SymmetricSecurityKey(
Encoding.UTF8.GetBytes(builder.Configuration["Jwt:Key"]!));
A token made with that same key:
$token = .\mint\bin\Debug\net10.0\Mint.exe "fix11-test-only-signing-key-0123456789abcdef" https://issuer.test fix11-api 30 0
curl.exe -i http://127.0.0.1:15600/patients -H "Authorization: Bearer $token"
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Date: Sat, 14 Nov 2026 01:13:01 GMT
Server: Kestrel
Transfer-Encoding: chunked
["Maria Garcia","David Chen"]
Read the key from one configuration value in both places and print its length at start-up if you are unsure which value won. If the API had no key configured at all, the log would say IDX10500 instead; that case has its own post.
How it was reproduced
A dotnet new web -f net10.0 API with Microsoft.AspNetCore.Authentication.JwtBearer
10.0.15 (Microsoft.IdentityModel 8.19.2), one endpoint /patients with
RequireAuthorization(), run on 127.0.0.1:15600 on the ASP.NET Core 10.0.15
runtime, SDK 11.0.100. Tokens came from a small console project on
System.IdentityModel.Tokens.Jwt 8.19.2 that signs with HS256 and takes key, issuer, audience
and lifetime as arguments; requests were sent with curl 8.22.0 on Windows. The
Microsoft.AspNetCore.Authentication log category was set to Information in
appsettings.json, because these lines are logged at Information level and the test's
appsettings.json sets Microsoft.AspNetCore to Warning.
Frequently asked
- What does 'The signature key was not found' mean in ASP.NET Core?
- The API could not verify the token's signature with the key in TokenValidationParameters. In the test the token had been signed with a different key, and the server log showed IDX10517.
- Why does IDX10517 say the token's kid is missing?
- The token has no kid header, so the handler cannot pick a key by id and tries the keys it has. The message lists the key it tried; the signature still did not match it.
- How do I fix IDX10517 with a symmetric key?
- Sign the token and validate it with the same key bytes, read from one configuration value. In the test, minting the token with the API's key turned the 401 into a 200.
More decoded errors in the Fixes category. If the API answers with a 500 about a missing scheme instead of a 401, see No authenticationScheme was specified.