[Commits] [SCM] claws branch, master, updated. 4.2.0-70-g357c5342d

jonathan at claws-mail.org jonathan at claws-mail.org
Sun Mar 24 16:45:28 UTC 2024


The branch, master has been updated
       via  357c5342dd3e36a8a629929918dda7196e3f906d (commit)
      from  d6f80be16b3183693b4300346fdbdc6c7c342d4f (commit)

Summary of changes:
 src/oauth2.c        | 24 +++++++++++++++++++++---
 src/oauth2.h        |  1 +
 src/pop.c           |  3 ++-
 src/prefs_account.c |  1 +
 4 files changed, 25 insertions(+), 4 deletions(-)


- Log -----------------------------------------------------------------
commit 357c5342dd3e36a8a629929918dda7196e3f906d
Author: Jonathan Boeing <jonathan at claws-mail.org>
Date:   Sun Mar 24 02:39:59 2024 -0700

    Add OAUTH2 support for Microsoft 365 GCC High

diff --git a/src/oauth2.c b/src/oauth2.c
index bb15603cb..681543bca 100644
--- a/src/oauth2.c
+++ b/src/oauth2.c
@@ -48,7 +48,7 @@
 //Yahoo requires token requests to send POST header Authorization: Basic
 //where the password is Base64 encoding of client_id:client_secret
 
-static gchar *OAUTH2info[4][17]={
+static gchar *OAUTH2info[5][17]={
   {"accounts.google.com",
    "",
    ".",
@@ -100,7 +100,24 @@ static gchar *OAUTH2info[4][17]={
    "offline_access https://outlook.office.com/IMAP.AccessAsUser.All https://outlook.office.com/POP.AccessAsUser.All https://outlook.office.com/SMTP.Send",
    "query",
    ""},
-  {"api.login.yahoo.com",
+   {"login.microsoftonline.us",
+   "",
+   "",
+   "http://127.0.0.1:8888",
+   "/common/oauth2/v2.0/authorize",
+   "/common/oauth2/v2.0/token",
+   "/common/oauth2/v2.0/token",
+   "code",
+   "offline_access https://outlook.office365.us/IMAP.AccessAsUser.All https://outlook.office365.us/POP.AccessAsUser.All https://outlook.office365.us/SMTP.Send",
+   "authorization_code",
+   "refresh_token",
+   "common",
+   "",
+   "offline",
+   "offline_access https://outlook.office365.us/IMAP.AccessAsUser.All https://outlook.office365.us/POP.AccessAsUser.All https://outlook.office365.us/SMTP.Send",
+   "query",
+   ""},
+ {"api.login.yahoo.com",
    "",
    ".",
    "oob",
@@ -119,11 +136,12 @@ static gchar *OAUTH2info[4][17]={
    "1"}
 };
 
-static gchar *OAUTH2CodeMarker[5][2] = {
+static gchar *OAUTH2CodeMarker[6][2] = {
     {"",""},
     {"code=","&scope="},
     {"code="," HTTP"},
     {"code=","&session_state="},
+    {"code=","&session_state="},
     {"yahoo_begin_mark","yahoo_end_mark"} /* Not used since token avalable to user to copy in browser window */
 };
 
diff --git a/src/oauth2.h b/src/oauth2.h
index 51eb60dcf..d4a5d9378 100644
--- a/src/oauth2.h
+++ b/src/oauth2.h
@@ -59,6 +59,7 @@ typedef enum
 	OAUTH2AUTH_GOOGLE,
 	OAUTH2AUTH_OUTLOOK,
 	OAUTH2AUTH_EXCHANGE,
+	OAUTH2AUTH_MICROSOFT_GCCHIGH,
 	OAUTH2AUTH_YAHOO,
 	OAUTH2AUTH_LAST = OAUTH2AUTH_YAHOO
 } Oauth2Service;
diff --git a/src/pop.c b/src/pop.c
index 695f5a072..e06a142e2 100644
--- a/src/pop.c
+++ b/src/pop.c
@@ -245,7 +245,8 @@ static gint pop3_getauth_oauth2_send(Pop3Session *session)
 {
 	gint oauth2_provider = session->ac_prefs->oauth2_provider;
 	return (  oauth2_provider == OAUTH2AUTH_OUTLOOK ||
-		  oauth2_provider == OAUTH2AUTH_EXCHANGE
+		  oauth2_provider == OAUTH2AUTH_EXCHANGE ||
+		  oauth2_provider == OAUTH2AUTH_MICROSOFT_GCCHIGH
 		? pop3_getauth_oauth2_send_microsoft_1(session)
 		: pop3_getauth_oauth2_send_generic(session)
 		);
diff --git a/src/prefs_account.c b/src/prefs_account.c
index b9a14c2a8..8c63ebfae 100644
--- a/src/prefs_account.c
+++ b/src/prefs_account.c
@@ -2287,6 +2287,7 @@ static void oauth2_create_widget_func(PrefsPage * _page,
 	COMBOBOX_ADD (menu, "Google/Gmail", OAUTH2AUTH_GOOGLE);
 	COMBOBOX_ADD (menu, "MS Outlook", OAUTH2AUTH_OUTLOOK);
 	COMBOBOX_ADD (menu, "MS Exchange", OAUTH2AUTH_EXCHANGE);
+	COMBOBOX_ADD (menu, "MS 365 GCC High", OAUTH2AUTH_MICROSOFT_GCCHIGH);
 	COMBOBOX_ADD (menu, "Yahoo", OAUTH2AUTH_YAHOO);
 
 	protocol_optmenu = g_new(struct BasicProtocol, 1);

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list