I have a code to add an event in a calendar. The code has been working succesfully until few weeks ago when I got the following error:

{"error":{"code":"InvalidAuthenticationToken","message":"IDX14100: JWT is not well formed: ' PII of type 'Microsoft.IdentityModel.Logging.SecurityArtifact' is hidden. For more details, see [https://aka.ms/IdentityModel/PII.]' , there are no dots (.).\nThe token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EndcodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'.","innerError":{"date":"2023-09-27T09:52:24","request-id":"ecf7db65-e055-4b20-b5cd-1a3e746a7c6c","client-request-id":"ecf7db65-e055-4b20-b5cd-1a3e746a7c6c"}}}

The httpRequest for https://graph.microsoft.com/v1.0/me/calendar/events returns status 401.

I'm sending the following headers:

Content-Type=application/json

Authorization=Bearer theToken

Nothing seems to have changed in the system. What am I missing?

Thanks

Same error: IDX14100: JWT is not well formed, there are no dots (.).

The token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EndcodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'. Kindly help if you got any solution.

I'm getting the same error when using a token to access the MS Graph API, but it only occurs 60 minutes after the first token is received. It appears Microsoft Graph API is returning this error when my token has expired rather than what I expected, an 80049228 error code.

To fix this, I simply assume the above error is an expiration error and use the stored refresh token to grab another access token. It's quite odd, as the tokens work fine for the first hour. Once they're expired, I'd expect a better error message than this.

Thank you for the reply. Issue has been resolved when I was passing the token wrong as "Bearer eydghdffgfdg...." space between the Bearer and token removed and issue got solved. I don't know will be the same for others. Regards, Taniya

Facing same issue, applied all solution mentioned above, but still error remains.

{"error":{"code":"InvalidAuthenticationToken","message":"IDX14100: JWT is not well formed, there are no dots (.).\nThe token needs to be in JWS or JWE Compact Serialization Format. (JWS): 'EncodedHeader.EndcodedPayload.EncodedSignature'. (JWE): 'EncodedProtectedHeader.EncodedEncryptedKey.EncodedInitializationVector.EncodedCiphertext.EncodedAuthenticationTag'.","innerError":{"date":"2024-05-21T16:49:16","request-id":"13247f8e-9d40-4f74-88bd-52a90706f45f","client-request-id":"13247f8e-9d40-4f74-88bd-52a90706f45f"}}}