IDX14100: JWT is not well formed, there are no dots (.). in the server log means
the text after Bearer in the Authorization header is not a JWT at all. The
client gets only WWW-Authenticate: Bearer error="invalid_token", with no
description. Send the token itself, three Base64Url parts joined by dots, after one
Bearer and a space.
Print the exact header your client sends. In the test, the word hello in place
of a token gave IDX14100, and a doubled Bearer Bearer prefix gave a different
code, IDX14102, shown further down.
The error
The response, from curl.exe -i:
curl.exe -i http://127.0.0.1:15600/patients -H "Authorization: Bearer hello"
HTTP/1.1 401 Unauthorized
Content-Length: 0
Date: Sat, 14 Nov 2026 01:13:02 GMT
Server: Kestrel
WWW-Authenticate: Bearer error="invalid_token"
The server console:
info: Microsoft.AspNetCore.Authentication.JwtBearer.JwtBearerHandler[1]
Failed to validate the token.
Microsoft.IdentityModel.Tokens.SecurityTokenMalformedException: IDX14100: JWT is not well formed, there are no dots (.).
The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EncodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'.
...
Why it happens
A signed JWT is header.payload.signature. The handler takes what follows the
Bearer scheme and reads it as a JWT; hello has no dots. The stack
trace under the message ends in JsonWebTokenHandler.ReadToken, and no line
about the key, the issuer or the lifetime follows it.
The same mistake with a doubled prefix: IDX14102
A client that adds Bearer to a value that already starts with it sends
Bearer Bearer eyJ.... That text has dots, so the message changes:
curl.exe -i http://127.0.0.1:15600/patients -H "Authorization: Bearer Bearer $token"
HTTP/1.1 401 Unauthorized
...
WWW-Authenticate: Bearer error="invalid_token"
...
System.ArgumentException: IDX14102: Unable to decode the header '[PII of type 'Microsoft.IdentityModel.Logging.SecurityArtifact' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]' as Base64Url encoded string.
---> System.FormatException: IDX10400: Unable to decode: '[PII of type 'System.String' is hidden. For more details, see https://aka.ms/IdentityModel/PII.]' as Base64url encoded string.
...
With IdentityModelEventSource.ShowPII = true on a second instance of the API
(development only), the hidden value of the IDX10400 line became
'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', which shows the second
Bearer plainly.
The fix
$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
...
["Maria Garcia","David Chen"]
One Bearer, one space, then the raw token. If your client builds the header
from a stored value, log that value once and check it does not already start with
Bearer.
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 protected with
RequireAuthorization(), on 127.0.0.1:15600 with the ASP.NET Core 10.0.15 runtime
and SDK 11.0.100; the ShowPII instance ran on 15602. Tokens came from a console project on
System.IdentityModel.Tokens.Jwt 8.19.2 with a made-up test key, and requests went through
curl 8.22.0 from Windows PowerShell 5.1. A token wrapped in double quotes was not tested:
the request written that way from PowerShell 5.1 ("Authorization: Bearer ""$token""")
got a 200, so it cannot show what a quoted token does.
Frequently asked
- What does IDX14100 JWT is not well formed mean?
- The value after Bearer in the Authorization header has no dots, so it cannot be a JWT. In the test the header Bearer hello produced it, and the client saw only error="invalid_token".
- Why do I get IDX14102 Unable to decode the header?
- In the test it came from a doubled prefix, Bearer Bearer followed by the token. The first part the handler read was the word Bearer plus the token header, which is not Base64Url.
- How should the Authorization header look for a JWT?
- Authorization: Bearer followed by one space and the token's three dotted parts, nothing else. In the test that header got a 200.
More decoded errors in the Fixes category. For the hidden values in these messages, see PII of type 'System.String' is hidden.