I am a mail client developer and since 2021-09-24 I face the problem that I can get OAuth tokens just fine as before, but the XAUTH2 login fails. This worked before in my app and now it fails in several independent apps like eM Client, Aqua Mail, Fair Email, etc.
Interestingly enough, the Android Gmail app still succeeds adding an outlook account.
The corresponding server client communication is like this:
A: connecting to server outlook.office365.com:993 - secure: true
S: * OK The Microsoft Exchange IMAP4 service is ready. [QQBNADMAUABSADAANwBDAEEAMAAxADMANQAuAGUAdQByAHAAcgBkADAANwAuAHAAcgBvAGQALgBvAHUAdABsAG8AbwBrAC4AYwBvAG0A]C: a0 AUTHENTICATE XOAUTH2 (base64 code scrambled)
S: a0 NO AUTHENTICATE failed.
As several apps are affected and I can still login fine into Gmail using the same code, it seems unlikely that this is a client problem. It seems that the IMAP server outlook.office365.com does not accept XAUTH2 anymore, requires additional/different scopes or tokens that have been genererated differently. I re-checked with the documentation, but this is still the same https://docs.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth
In my case I got approved for the following scopes: https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/SMTP.Send offline\_access
I can still sign into smtp.office365.com:587 using the same access token to send mail.
Thanks for any help!
Robert