Mail and microsoft Oauth2: No Activity found to handle Intent
- /e/ version: v1.5 dev
- Device model(s): FP3
- Device rooted: no
Summary
You can't login to microsoft / Outlook / live.com Accounts with Mail since Oauth2 intro. If you get past the tracker blocking (in #5855 (closed)), you run into a bug stemming from k9mail forking.
The Microsoft Oauth2 implementation in k9mail works.
The problem
Steps to reproduce
- disable Advanced Privacy tracking protection / or disable the Microsoft Engagement tracker for Mail and Browser
- use Firefox, as the default browser (Bromite) does not output any verbose logging for the issue
- add an outlook365 Online Account to Mail
- see logcat
What is the current behavior?
either you'll see a error message in Firefox not leading you on or in the default Browser the continue Button will do nothing
What is the expected correct behavior?
Oauth2 account added to Mail
Technical informations
most relevant are the first two lines:
E App : failed to start third party app activity
E App : android.content.ActivityNotFoundException: No Activity found to handle Intent { act=android.intent.action.VIEW cat=[android.intent.category.BROWSABLE] dat=msauth://com.fsck.k9/Dx8yUsuhyU3dYYba1aA16Wxu5eM=?code=asdf flg=0x10000000 (has extras) }
E App : at android.app.Instrumentation.checkStartActivityResult(Instrumentation.java:2071)
E App : at android.app.Instrumentation.execStartActivity(Instrumentation.java:1731)
E App : at android.app.Activity.startActivityForResult(Activity.java:5314)
E App : at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:2)
E App : at android.app.Activity.startActivityForResult(Activity.java:5272)
E App : at androidx.activity.ComponentActivity.startActivityForResult(ComponentActivity.java:1)
E App : at android.app.Activity.startActivity(Activity.java:5658)
E App : at android.app.Activity.startActivity(Activity.java:5611)
E App : at mozilla.components.feature.app.links.AppLinksUseCases$OpenAppLinkRedirect.invoke$default(AppLinksUseCases.kt:9)
...
Solutions
Workaround
none
Possible fixes
see https://community.e.foundation/t/mail-with-outlook-office365-servera/44851/9 - most likely changing the OAUTH_MICROSOFT_REDIRECT_URI
constant so the intent-filter at https://gitlab.e.foundation/e/os/mail/-/blob/a59f9b37/app/k9mail/src/main/AndroidManifest.xml#L433 can work.
(Might discuss if /e/ should get their own client ids for Oauth2 with the remotes).
I was unfamiliar with manifestPlaceholders / appAuthRedirectScheme at e/os/mail@8d10aff0 and deliberated if this should make a difference. I concluded that the host field will not match the application anyway.
<data android:scheme="msauth" android:host="${applicationId}"/>