[evolution-ews/gnome-3-24] e_ews_connection_try_credentials_sync() asks for password when not needed



commit bc33cd9e48f1a568f34c4b9b91b1eea2e93a0d8e
Author: Milan Crha <mcrha redhat com>
Date:   Thu Jun 1 17:51:03 2017 +0200

    e_ews_connection_try_credentials_sync() asks for password when not needed
    
    With NTLM authentication, when /usr/bin/ntlm_auth returns something
    meaningful, it doesn't necessarily mean that it can provide password,
    thus count with it in e_ews_connection_try_credentials_sync() and
    return authentication result according to the password being part
    of the provided credentials or not. This avoids unnecessary credentials
    prompts, fox example when opening address books.

 src/server/e-ews-connection.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/src/server/e-ews-connection.c b/src/server/e-ews-connection.c
index 0c7d84a..6a1b85c 100644
--- a/src/server/e-ews-connection.c
+++ b/src/server/e-ews-connection.c
@@ -2281,7 +2281,13 @@ e_ews_connection_try_credentials_sync (EEwsConnection *cnc,
 
                if (auth_failed) {
                        g_clear_error (&local_error);
-                       result = E_SOURCE_AUTHENTICATION_REJECTED;
+
+                       if (camel_ews_settings_get_auth_mechanism (cnc->priv->settings) != 
EWS_AUTH_TYPE_GSSAPI && (!credentials ||
+                           !e_named_parameters_exists (credentials, E_SOURCE_CREDENTIAL_PASSWORD))) {
+                               result = E_SOURCE_AUTHENTICATION_REQUIRED;
+                       } else {
+                               result = E_SOURCE_AUTHENTICATION_REJECTED;
+                       }
                } else {
                        g_propagate_error (error, local_error);
                        result = E_SOURCE_AUTHENTICATION_ERROR;


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