Added OAuth Outlook test config

pull/212/head
M66B 2 years ago
parent 101f8f2028
commit aa99a08c66

@ -181,7 +181,7 @@ public class EntityAccount extends EntityOrder implements Serializable {
}
static boolean isOutlook(String id) {
return ("office365".equals(id) || "office365pcke".equals(id) || "outlook".equals(id));
return ("office365".equals(id) || "office365pcke".equals(id) || "outlook".equals(id) || "outlooktest".equals(id));
}
boolean isYahooJp() {

@ -296,7 +296,7 @@ public class FragmentSetup extends FragmentBase implements SharedPreferences.OnS
int order = 1;
// OAuth
order = getMenuItems(menu, context, providers, order, false);
order = getMenuItems(menu, context, providers, order, false, debug);
menu.add(Menu.NONE, R.string.title_setup_other, order++, R.string.title_setup_other)
.setIcon(R.drawable.twotone_auto_fix_high_24);
@ -315,7 +315,7 @@ public class FragmentSetup extends FragmentBase implements SharedPreferences.OnS
item.setIcon(resid);
}
order = getMenuItems(menu, context, providers, order, true);
order = getMenuItems(menu, context, providers, order, true, debug);
SpannableString ss = new SpannableString(getString(R.string.title_setup_pop3));
ss.setSpan(new RelativeSizeSpan(HtmlHelper.FONT_SMALL), 0, ss.length(), 0);
@ -403,13 +403,13 @@ public class FragmentSetup extends FragmentBase implements SharedPreferences.OnS
popupMenu.show();
}
private int getMenuItems(Menu menu, Context context, List<EmailProvider> providers, int order, boolean alt) {
private int getMenuItems(Menu menu, Context context, List<EmailProvider> providers, int order, boolean alt, boolean debug) {
Resources res = context.getResources();
String pkg = context.getPackageName();
for (EmailProvider provider : providers)
if (provider.oauth != null &&
provider.oauth.enabled &&
(provider.oauth.enabled || (provider.debug && debug)) &&
!TextUtils.isEmpty(provider.oauth.clientId) &&
provider.alt == alt) {
String title = getString(R.string.title_setup_oauth, provider.description);

@ -198,10 +198,51 @@
<!-- https://docs.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth -->
<!-- https://learn.microsoft.com/en-us/azure/active-directory/develop/redirect-uris-ios -->
</provider>
<provider
name="Outlook test"
debug="true"
description="Office 365 test"
id="outlooktest"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14"
maxtls="1.2"
noop="true"
order="5"
partial="false"
useip="false">
<imap
host="outlook.office365.com"
port="993"
starttls="false" />
<smtp
host="smtp.office365.com"
port="587"
starttls="true" />
<pop
host="outlook.office365.com"
port="995"
starttls="false" />
<oauth
askAccount="true"
authorizationEndpoint="https://login.microsoftonline.com/consumers/oauth2/v2.0/authorize"
clientId="835c3383-543c-4aa2-98ca-c465eb039987"
enabled="false"
privacy="https://privacy.microsoft.com/privacystatement"
prompt="login"
redirectUri="msauth://eu.faircode.email/xSLzBBuLJunOQPB89rtzM54FXx4%3D"
scopes="profile,openid,email,offline_access,https://outlook.office.com/IMAP.AccessAsUser.All,https://outlook.office.com/SMTP.Send"
tokenEndpoint="https://login.microsoftonline.com/consumers/oauth2/v2.0/token"
tokenScopes="true">
<!--parameter
key="domain_hint"
value="9188040d-6c67-4c5b-b112-36a304b66dad" /-->
</oauth>
<!-- https://docs.microsoft.com/en-us/azure/active-directory/develop/v2-oauth2-auth-code-flow -->
<!-- https://docs.microsoft.com/en-us/exchange/client-developer/legacy-protocols/how-to-authenticate-an-imap-pop-smtp-application-by-using-oauth -->
<!-- https://learn.microsoft.com/en-us/azure/active-directory/develop/redirect-uris-ios -->
</provider>
<provider
name="Outlook"
alt="true"
debug="true"
description="Office 365 (alt)"
id="outlook"
link="https://github.com/M66B/FairEmail/blob/master/FAQ.md#user-content-faq14"

Loading…
Cancel
Save