Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request for Microsoft Exchange OAuth2 #1645

Closed
chascode opened this issue Jun 30, 2024 · 8 comments
Closed

Feature request for Microsoft Exchange OAuth2 #1645

chascode opened this issue Jun 30, 2024 · 8 comments
Labels
extensions (plugin) external Issue is outside our code wontfix This will not be worked on workaround

Comments

@chascode
Copy link

Microsoft are dropping support for app passwords in September.

With an extension similar to "GMail OAuth2" (where I enter my client id/secret provided by Microsoft) I can still use snappymail after September.

I've considered using DavMail (available in debian's default repositories) as a gateway between snappymail and Microsoft's exchange servers.

@the-djmaze
Copy link
Owner

I was looking at it a few weeks ago, but had some trouble with it due to other changes Microsoft is making.

Will document my draft code and see what can be done.

the-djmaze pushed a commit that referenced this issue Jul 1, 2024
@the-djmaze
Copy link
Owner

the-djmaze commented Jul 1, 2024

I've added my draft code.
Microsoft requires an Azure account that has an active subscription.
I'm not going to pay, so feel free to get the code working yourself.

https://learn.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth

@the-djmaze the-djmaze added the wontfix This will not be worked on label Jul 1, 2024
@the-djmaze the-djmaze removed the enhancement New feature or request label Jul 1, 2024
@the-djmaze
Copy link
Owner

the-djmaze commented Jul 1, 2024

Showstopper issue redirect_uri=https://domain.tld/?LoginO365:

invalid_request: The provided value for the input parameter 'redirect_uri' is not valid. The expected value is a URI which matches a redirect URI registered for this client application.

Problem is Microsoft:
https://learn.microsoft.com/en-us/entra/identity-platform/reply-url#query-parameter-support-in-redirect-uris

Query parameters are not allowed in redirect URIs for any app registration configured to sign in users with personal Microsoft accounts such as Outlook.com (Hotmail)

afbeelding

afbeelding

the-djmaze pushed a commit that referenced this issue Jul 1, 2024
the-djmaze pushed a commit that referenced this issue Jul 1, 2024
the-djmaze pushed a commit that referenced this issue Jul 1, 2024
@the-djmaze the-djmaze added the external Issue is outside our code label Jul 1, 2024
@the-djmaze the-djmaze closed this as not planned Won't fix, can't repro, duplicate, stale Jul 1, 2024
the-djmaze pushed a commit that referenced this issue Jul 1, 2024
the-djmaze pushed a commit that referenced this issue Jul 1, 2024
@the-djmaze
Copy link
Owner

the-djmaze commented Jul 1, 2024

For experimental usage with SnappyMail v2.36.1+ (requires Apache AcceptPathInfo):
https://github.com/the-djmaze/snappymail/tree/master/plugins/login-o365

This should be the most comprehensive "not working" draft code for anyone that wants to try using the most annoying OAuth implementer that exists.

I always advice to stop using Microsoft products, but somehow too many "advisors" keep selling the crap that Microsoft produces.
Since we don't have the power to kill it (i even tried through the EU-government, regarding email vendor lock-in), this code should be enough to get you going with implementing it.

@GregThib
Copy link

GregThib commented Jul 2, 2024

Hi!

This workaround seem to introduce a new failure: under Apache 2.4+, without mod_access_compat, giving a 500 error when trying to connect.
The Allow directive is obsolete and should not be employed now.

Maybe, a fix is to test the presence of mod_access_compat, and if not, use Require instead?

@the-djmaze
Copy link
Owner

@GregThib sorry, my bad. That rule shouldn't be in and i removed it.

@GregThib
Copy link

GregThib commented Jul 2, 2024

@GregThib sorry, my bad. That rule shouldn't be in and i removed it.

No problem, I use the in-dev version via git fetch, so these kinds of "bugs" are normal outside tagged versions.
I just wanted to prevent, in case the faulty code remain later.

@the-djmaze
Copy link
Owner

the-djmaze commented Aug 12, 2024

Ok, back to the drawing board.
It killed the Nextcloud integration #1703
47d18ca#r144395031

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extensions (plugin) external Issue is outside our code wontfix This will not be worked on workaround
Projects
None yet
Development

No branches or pull requests

3 participants