"Modern Authentication" for Outlook account on KMail

Hi, I’m trying to use my Outlook (dot) com account on KMail, but I just got an email from Microsoft saying I can’t use basic authentication after September. It says it requires more than just username and password after that point.
I am currently using Debian 12 with Kontact/KMail 5.22.3 (22.12.3).
I think what they want is OAuth. I tried to use the EWS resource but with the EWS URL with outlook (dot) com /EWS/Exchange (dot) asmx . It loads before giving me a 401 error so I cannot get use the EWS method.
Is there some other way I can log in with OAuth2?

As far as I can tell, when Microsoft says “Modern Authentication” they indeed mean XOAUTH2. As per this discussion KMail does not support generic OAuth2 (though I understand it does XOAUTH2 with Gmail), and the relevant ticket to track is probably this: 457233 – Please provide oauth2 login for IMAP - not just Gmail

1 Like