dcblogdev / laravel-microsoft-graph

Laravel package for Microsoft Graph API (Microsoft365)
https://dcblog.dev/docs/laravel-microsoft-graph
Other
120 stars 51 forks source link

InvalidAuthenticationToken, CompactToken parsing failed with error code: 80049217 #41

Closed overwise closed 1 year ago

overwise commented 1 year ago

After a successful login, upon returning to the redirect URI, I get:

{
   "error":{
      "code":"InvalidAuthenticationToken",
      "message":"CompactToken parsing failed with error code: 80049217",
      "innerError":{
         "date":"2022-10-10T10:54:32",
         "request-id":"18925d88-bfc6-4d27-b579-7648264e1221",
         "client-request-id":"18925d88-bfc6-4d27-b579-7648264e1221"
      }
   }

I don't even know where to start with debugging, to be honest.

overwise commented 1 year ago

Fixed it. In case someone else gets stuck with this... I think the problem was that I didn't use MsGraphAuthenticated middleware for the redirect URI route. After adding that, everything seems to work fine.