[evolution-data-server/wip/mcrha/soup3] ESoupSession: Learn the NTLM auth



commit c80e635d579652d9c84566715a25aa70fc23ff14
Author: Milan Crha <mcrha redhat com>
Date:   Tue May 24 12:50:01 2022 +0200

    ESoupSession: Learn the NTLM auth

 src/libedataserver/e-soup-session.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/src/libedataserver/e-soup-session.c b/src/libedataserver/e-soup-session.c
index 56cff9660..c770d7d54 100644
--- a/src/libedataserver/e-soup-session.c
+++ b/src/libedataserver/e-soup-session.c
@@ -318,6 +318,16 @@ e_soup_session_maybe_prepare_auth (ESoupSession *session,
                                soup_session_add_feature_by_type (soup_session, SOUP_TYPE_AUTH_NEGOTIATE);
                        soup_session_remove_feature_by_type (soup_session, SOUP_TYPE_AUTH_BASIC);
 
+                       g_rec_mutex_unlock (&session->priv->session_lock);
+               } else if (g_strcmp0 (auth_method, "NTLM") == 0) {
+                       SoupSession *soup_session = SOUP_SESSION (session);
+
+                       g_rec_mutex_lock (&session->priv->session_lock);
+
+                       if (!soup_session_get_feature (soup_session, SOUP_TYPE_AUTH_NTLM))
+                               soup_session_add_feature_by_type (soup_session, SOUP_TYPE_AUTH_NTLM);
+                       /* Keep the basic auth, as a fallback */
+
                        g_rec_mutex_unlock (&session->priv->session_lock);
                } else if (user && *user) {
                        /* Default to Basic authentication when user is filled */


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