Office365 Token Expiration Issue


Office365 auth fails and requires re-auth daily, sometimes multiple times per day.

Here is the error message:

*** Mailspring Sync
*** An exception occurred during program execution:
*** {“debuginfo”:"Sign in to your account RETURNED {“error”:“invalid_grant”,“error_description”:“AADSTS700081: The refresh token has expired due to maximum lifetime. The token was issued on 2021-06-25T18:19:03.8630908Z and the maximum allowed lifetime for this application is 1.00:00:00.\r\nTrace ID: 474aa661-3f95-4223-a383-bbd359c57a00\r\nCorrelation ID: 1cb77c3f-cd21-4643-abb3-7239b8ee9889\r\nTimestamp: 2021-06-28 03:06:05Z”,“error_codes”:[700081],“timestamp”:“2021-06-28 03:06:05Z”,“trace_id”:“474aa661-3f95-4223-a383-bbd359c57a00”,“correlation_id”:“1cb77c3f-cd21-4643-abb3-7239b8ee9889”,“error_uri”:“"}",“key”:"Invalid Response Code: 400”,“retryable”:false,“what”:“std::exception”}

To Reproduce…

Not sure - have an Office365 account?

Expected Behavior

Don’t keep making me re-authorize!




  • OS and Version: Ubuntu 20.04
    • Installation Method: not sure
  • Mailspring Version: 1.91-30

Additional Context

Did this ever get resolved? I’m seeing what seems to be the same error where MailSpring is reusing an old token that is no longer valid:

The refresh token was issued to a single page app (SPA), and therefore has a fixed, limited lifetime of 1.00:00:00, which cannot be extended. It is now expired and a new sign in request must be sent by the SPA to the sign in page. The token was issued on 2021-12-02T18:11:38.5127961+00:00.

Any advice on fixing this or working around (e.g. by manually deleting the token) would be appreciated!

I am having same error. Using Mailspring in Windows 10, with office 365 with 2FA enabled. The error code gave me this info from Microsoft website -

Is there any solution for this?