Bug 457233 - Please provide oauth2 login for IMAP - not just Gmail
Summary: Please provide oauth2 login for IMAP - not just Gmail
Status: CONFIRMED
Alias: None
Product: Akonadi
Classification: Frameworks and Libraries
Component: IMAP resource (show other bugs)
Version: 6.1.2
Platform: Ubuntu Linux
: HI wishlist
Target Milestone: ---
Assignee: kdepim bugs
URL: https://learn.microsoft.com/en-us/exc...
Keywords:
: 444301 455113 462042 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-07-28 11:15 UTC by François Bissey
Modified: 2024-10-19 19:12 UTC (History)
24 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description François Bissey 2022-07-28 11:15:53 UTC
My organisation has moved to office365 but has not enabled EWS. This make the akonadi EWS component useless to me.
On the other hand they have enabled IMAP with OAUTH2. Thunderbird support IMAP+OAUTH2 for both receiving and sending and therefore works in my use case. kmail sadely doesn't as I cannot select oauth2 with an IMAP server.
Comment 1 Amand Tihon 2022-10-24 12:12:39 UTC
With Microsoft having started to disable all forms of basic auth for their office365 tenants, I think this bug deserves a higher importance.
Comment 2 Nicolás Alvarez 2022-10-27 15:51:31 UTC
Given that Office365 situation, I agree. I think it's still "wishlist" because it's a feature request, but I'll increase from "normal" to "high".
Comment 3 Boba Fit 2022-11-01 18:43:05 UTC
*** This bug has been confirmed by popular vote. ***
Comment 4 Boba Fit 2022-11-01 19:19:46 UTC
Does this commit is a good base to implement it?
https://invent.kde.org/pim/kimap/-/commit/f953e1bac598388154138282a90529d7ff04aca2
It was written by @dvratil
Comment 5 Jerôme Pouiller 2023-01-20 10:35:00 UTC
Does someone tried https://github.com/simonrob/email-oauth2-proxy ?
Comment 6 Aaron Williams 2023-01-21 09:29:03 UTC
I need this badly. Our IT department just changed the settings so I can no longer access my email on Office365 via IMAP. In addition, EWS is also failing since none of the user agents are supported (and there's a bug where it's impossible to override it for the first time, but this is unrelated to IMAP).
Comment 7 Aaron Williams 2023-01-28 04:53:51 UTC
Since Microsoft now mandates the use of oauth2 for IMAP with office365, this bug is now more important than ever. It is now impossible to use KMail/Kontact with Office365 without jumping through some major hoops with proxies, etc. Many corporate organizations use office365. I'm now stuck with Thunderbird for my work email and I am not at all happy about running that CPU pig (CPU usage is pegged at well over 100% at all times).
Comment 8 Björn Bidar (Thaodan) 2023-10-14 19:42:01 UTC
*** Bug 455113 has been marked as a duplicate of this bug. ***
Comment 9 Björn Bidar (Thaodan) 2023-10-14 19:42:19 UTC
*** Bug 462042 has been marked as a duplicate of this bug. ***
Comment 10 Björn Bidar (Thaodan) 2023-10-14 19:42:30 UTC
*** Bug 444301 has been marked as a duplicate of this bug. ***
Comment 11 Chris 2023-10-15 01:27:27 UTC
(In reply to Björn Bidar (Thaodan) from comment #8)
> *** Bug 455113 has been marked as a duplicate of this bug. ***

Bug 455113 is an actual bug because it does something it shouldn't: connecting to Gmail when it's a Yahoo address. In light of this, shouldn't this bug be considered an actual one too, instead of being classified as a mere wishlist item?
Comment 12 Chris 2024-03-13 00:00:52 UTC
This bug has 3 duplicates, all of which have importance "NOR normal": 444301 455113 462042.
I think it should be fair that the present issue has the same importance.
Comment 13 zocker.network 2024-07-22 21:00:08 UTC
I just want to add that this bug will also affect Microsoft Personal users in the near future as Microsoft will disable Basic Authentication for personal users on 2024-09-16 (source: https://support.microsoft.com/en-us/office/modern-authentication-methods-now-needed-to-continue-syncing-outlook-email-in-non-microsoft-email-apps-c5d65390-9676-4763-b41f-d7986499a90d). As far as I know & experimented so far, personal users cannot use the EWS protocol (& have no admin they can ask for enabling it), which makes that even more bad.

But, I can slightly understand why enabling XOAUTH2 for Microsoft Office 365 / Personal as well might be not as simple as it may seem, because KMail will then also need hard-coded settings for Microsoft’s OAuth2 endpoints, which includes a per-application secret (which feels ridiculous as they can easily be extracted, especially in the case of open-source software).
Comment 14 Jerôme Pouiller 2024-07-22 21:02:41 UTC
For information, I now use https://github.com/simonrob/email-oauth2-proxy + akonadi with success.
Comment 15 François Bissey 2024-07-22 21:07:27 UTC
(In reply to zocker.network from comment #13)
> But, I can slightly understand why enabling XOAUTH2 for Microsoft Office 365
> / Personal as well might be not as simple as it may seem, because KMail will
> then also need hard-coded settings for Microsoft’s OAuth2 endpoints, which
> includes a per-application secret (which feels ridiculous as they can easily
> be extracted, especially in the case of open-source software).

I hear what you say. At the same time thunderbird manages to provide it. I think the per application secret is more subtle than just having one for the application as a product but I need to dig on that.
Comment 16 Aaron Williams 2024-07-22 21:36:16 UTC
In my case, I can't use EWS and must use IMAP with Office365 due to another bug in Akonadi with the EWS protocol. If you have a lot of email, like I do, the server will send an error message telling the EWS client to stop downloading email for some period of time, i.e. 5 minutes. Unfortunately, Akonadi and most other EWS clients do not handle this and barf. The only email client I can run now on Linux with Office365 with Oauth is Thunderbird, which I hate.
Comment 17 Serena Star 2024-07-24 22:49:21 UTC
This is getting dire at this point. I cannot log into my Outlook (dot) com account on Debian 12. I have 2 factor authentication on and have tried using an app password but I keep getting an error about "Login failed, server replied: A000004 NO AUTHENTICATE failed."
We need OAUTH2 logins supported immediately on Kontact.
Comment 18 Lorenzo 2024-08-11 20:20:05 UTC
I can also confirm it is no longer working and I am getting the A000004 NO AUTHENTICATE error in KMail on Fedora 40 with a personal Outlook account. I'd really prefer staying on KDE rather than switching over to Thunderbird
Comment 19 Michael Tsang 2024-10-11 14:36:40 UTC
Pushing this. The deadline has already past and I can no longer receive emails in KMail unless a workaround is given.
Comment 20 Freek de Kruijf 2024-10-16 14:55:42 UTC
(In reply to Michael Tsang from comment #19)
> Pushing this. The deadline has already past and I can no longer receive
> emails in KMail unless a workaround is given.

The workaround is given in comment #14, however what needs to be done on the website of Microsoft is quite unclear. At least I could not figure it out.
Comment 21 Runxi Yu 2024-10-19 18:55:20 UTC
I ended up adding a normal IMAP account, using output from https://git.sr.ht/~runxiyu/tooch/tree/master/item/ykpsmuttauth/ykpsmuttauth.go as the Password field, and selecting OAUTH2 as the authentication method.

The program above is my cleaned-up version of https://github.com/muttmua/mutt/blob/master/contrib/mutt_oauth2.py, which generates a refresh token. The refresh token goes in the password field.

This works for me, but it's not obvious, and a proper interface would be appreciated.
Comment 22 Runxi Yu 2024-10-19 19:12:07 UTC
(In reply to Runxi Yu from comment #21)
> I ended up adding a normal IMAP account, using output from
> https://git.sr.ht/~runxiyu/tooch/tree/master/item/ykpsmuttauth/ykpsmuttauth.
> go as the Password field, and selecting OAUTH2 as the authentication method.
> 
> The program above is my cleaned-up version of
> https://github.com/muttmua/mutt/blob/master/contrib/mutt_oauth2.py, which
> generates a refresh token. The refresh token goes in the password field.
> 
> This works for me, but it's not obvious, and a proper interface would be
> appreciated.

I was wrong; the token expires in about half a hour. That was an access token, not a refresh token.