[evolution-ews] Allow OAuth2 for any server, not only for outlook.office365.com



commit 5b92ab6eb049a11035d7ac7a18f9397ff7f8d797
Author: Milan Crha <mcrha redhat com>
Date:   Tue Sep 22 10:20:15 2020 +0200

    Allow OAuth2 for any server, not only for outlook.office365.com
    
    Partly related to https://gitlab.gnome.org/GNOME/evolution-ews/-/issues/62
    and https://gitlab.gnome.org/GNOME/evolution-ews/-/issues/121

 src/EWS/common/e-ews-connection.c           | 8 +-------
 src/EWS/common/e-oauth2-service-office365.c | 3 +--
 2 files changed, 2 insertions(+), 9 deletions(-)
---
diff --git a/src/EWS/common/e-ews-connection.c b/src/EWS/common/e-ews-connection.c
index 9878f2c9..1d318068 100644
--- a/src/EWS/common/e-ews-connection.c
+++ b/src/EWS/common/e-ews-connection.c
@@ -10403,13 +10403,7 @@ ews_connection_gather_auth_methods_cb (SoupMessage *message,
 
        if (!has_bearer) {
                /* Special-case Office365 OAuth2, because outlook.office365.com doesn't advertise Bearer */
-               SoupURI *suri;
-
-               suri = soup_message_get_uri (message);
-               if (suri && soup_uri_get_host (suri) &&
-                   g_ascii_strcasecmp (soup_uri_get_host (suri), "outlook.office365.com") == 0) {
-                       async_data->items = g_slist_prepend (async_data->items, g_strdup ("Bearer"));
-               }
+               async_data->items = g_slist_prepend (async_data->items, g_strdup ("Bearer"));
        }
 
        g_object_set_data (G_OBJECT (simple), EWS_OBJECT_KEY_AUTHS_GATHERED, GINT_TO_POINTER (1));
diff --git a/src/EWS/common/e-oauth2-service-office365.c b/src/EWS/common/e-oauth2-service-office365.c
index 1e50e680..0727b647 100644
--- a/src/EWS/common/e-oauth2-service-office365.c
+++ b/src/EWS/common/e-oauth2-service-office365.c
@@ -82,8 +82,7 @@ eos_office365_guess_can_process (EOAuth2Service *service,
                                 const gchar *hostname)
 {
        return e_oauth2_services_is_supported () &&
-               protocol && g_ascii_strcasecmp (protocol, "ews") == 0 &&
-               hostname && e_util_utf8_strstrcase (hostname, "outlook.office365.com");
+               protocol && g_ascii_strcasecmp (protocol, "ews") == 0;
 }
 
 static const gchar *


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]