Bug 1528136 - add details to enable OAuth2 for Office 365. r=aleca
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Mon, 20 Apr 2020 20:28:09 +0300
changeset 37998 6e1d49280545bb8996902c188e4823e738e83b7c
parent 37997 553b3e0e942a25cd48300f44dc6c72b6222bfe0a
child 37999 62453d8cdbb795a82b49d3d1bd2c99b9fecf7c3a
push id2595
push userclokep@gmail.com
push dateMon, 04 May 2020 19:02:04 +0000
treeherdercomm-beta@f53913797371 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleca
bugs1528136
Bug 1528136 - add details to enable OAuth2 for Office 365. r=aleca
mailnews/base/util/OAuth2Providers.jsm
--- a/mailnews/base/util/OAuth2Providers.jsm
+++ b/mailnews/base/util/OAuth2Providers.jsm
@@ -26,16 +26,31 @@ var kHostnames = new Map([
 
   ["imap.mail.yahoo.com", ["login.yahoo.com", "mail-w"]],
   ["pop.mail.yahoo.com", ["login.yahoo.com", "mail-w"]],
   ["smtp.mail.yahoo.com", ["login.yahoo.com", "mail-w"]],
 
   ["imap.aol.com", ["login.aol.com", "mail-w"]],
   ["pop.aol.com", ["login.aol.com", "mail-w"]],
   ["smtp.aol.com", ["login.aol.com", "mail-w"]],
+
+  [
+    "outlook.office365.com",
+    [
+      "login.microsoftonline.com",
+      "https://outlook.office365.com/IMAP.AccessAsUser.All https://outlook.office365.com/POP.AccessAsUser.All https://outlook.office365.com/SMTP.Send offline_access",
+    ],
+  ],
+  [
+    "smtp.office365.com",
+    [
+      "login.microsoftonline.com",
+      "https://outlook.office365.com/IMAP.AccessAsUser.All https://outlook.office365.com/POP.AccessAsUser.All https://outlook.office365.com/SMTP.Send offline_access",
+    ],
+  ],
 ]);
 
 /**
  * Map of issuers to clientId, clientSecret, authorizationEndpoint, tokenEndpoint.
  * Issuer is a unique string for the organization that a Thunderbird account
  * was registered at.
  *
  * For the moment these details are hard-coded, since dynamic client
@@ -85,16 +100,27 @@ var kIssuers = new Map([
     "login.aol.com",
     [
       "dj0yJmk9OXRHc1FqZHRQYzVvJmQ9WVdrOU1UQnJOR0pvTjJrbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD02NQ--",
       "79c1c11991d148ddd02a919000d69879942fc278",
       "https://api.login.aol.com/oauth2/request_auth",
       "https://api.login.aol.com/oauth2/get_token",
     ],
   ],
+
+  [
+    "login.microsoftonline.com",
+    [
+      "08162f7c-0fd2-4200-a84a-f25a4db0b584", // Application (client) ID
+      "TxRBilcHdC6WGBee]fs?QR:SJ8nI[g82", // @see App registrations | Certificates & secrets
+      // https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-v2-protocols#endpoints
+      "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
+      "https://login.microsoftonline.com/common/oauth2/v2.0/token",
+    ],
+  ],
 ]);
 
 /**
  * OAuth2Providers: Methods to lookup OAuth2 parameters for supported OAuth2
  * providers.
  */
 var OAuth2Providers = {
   /**