{"id":9038,"date":"2022-08-17T06:08:08","date_gmt":"2022-08-17T06:08:08","guid":{"rendered":"https:\/\/blogs.aaddevsup.xyz\/?p=9038"},"modified":"2022-08-24T19:31:34","modified_gmt":"2022-08-24T19:31:34","slug":"receiving-error-compacttoken-parsing-failed-when-calling-microsoft-graph","status":"publish","type":"post","link":"https:\/\/blogs.aaddevsup.xyz\/2022\/08\/receiving-error-compacttoken-parsing-failed-when-calling-microsoft-graph\/","title":{"rendered":"Receiving error “CompactToken parsing failed” when calling Microsoft Graph"},"content":{"rendered":"\n
You may receive the following 401 error calling MS Graph endpoint (https:\/\/graph.microsoft.com)<\/p>\n\n\n\n
{\n \"error\": {\n \"code\": \"InvalidAuthenticationToken\",\n \"message\": \"CompactToken parsing failed with error code: 80049217\",<\/mark>\n \"innerError\": {\n \"date\": \"2022-08-16T19:00:22\",\n \"request-id\": \"xxx\",\n \"client-request-id\": \"yyy\"\n }\n }\n}\n\n<\/pre>\n\n\n\nWhat’s the cause of the error?<\/h3>\n\n\n\n
The error typically happens due to the following reasons:<\/p>\n\n\n\n
- There is no Bearer Access Token in the Request’s Authorization Header<\/li>
- The value of the Authorization Header is in incorrect format<\/li>
- The Bearer access token is invalid<\/li><\/ul>\n\n\n\n
Below are few examples of incorrect HTTP Request’s Authorization Header resulting in the error:<\/p>\n\n\n\n
# no token after 'Bearer'<\/mark>\nAuthorization: Bearer\n\n# no space between 'Bearer' and token<\/mark>\nAuthorization: Bearereyxxxx....\n\n# Bearer token unparsable or in incorrect json format<\/mark>\nAuthorization: Bearer eyxxxx\n<\/pre>\n","protected":false},"excerpt":{"rendered":"You may receive the following 401 error calling MS Graph endpoint (https:\/\/graph.microsoft.com) { “error”: { “code”: “InvalidAuthenticationToken”, “message”: “CompactToken parsing failed with error code: 80049217”, “innerError”: { “date”: “2022-08-16T19:00:22”, “request-id”: “xxx”, “client-request-id”: “yyy” } } } What’s the cause of the error? The error typically happens due to the following reasons: There is no Bearer Access Token in the Request’s Authorization Header The value of the Authorization Header is in…<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[77,100],"class_list":["post-9038","post","type-post","status-publish","format-standard","hentry","category-microsoftgraph","tag-graph","tag-microsoft-graph"],"_links":{"self":[{"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/posts\/9038"}],"collection":[{"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/comments?post=9038"}],"version-history":[{"count":5,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/posts\/9038\/revisions"}],"predecessor-version":[{"id":9043,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/posts\/9038\/revisions\/9043"}],"wp:attachment":[{"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/media?parent=9038"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/categories?post=9038"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.aaddevsup.xyz\/wp-json\/wp\/v2\/tags?post=9038"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}