[libsoup/gnome-3-22] Bug 788238 - Fallback to another authentication type if the current failed



commit adb51cb52b4ce6a513f3f17f2a0735673d70ddcd
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Sep 27 19:01:26 2017 +0200

    Bug 788238 - Fallback to another authentication type if the current failed
    
    Fallback to another authentication type if the current failed. More
    specifically if the Negotiate failed (kerberos is not properly
    configured), then libsoup should fallback to Basic auth (if server
    supports it). Currently in such case it is not possible to load the
    page at all (in WebKitGTK+).

 libsoup/soup-auth-manager.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/libsoup/soup-auth-manager.c b/libsoup/soup-auth-manager.c
index 9455265..c857cf5 100644
--- a/libsoup/soup-auth-manager.c
+++ b/libsoup/soup-auth-manager.c
@@ -354,7 +354,7 @@ create_auth (SoupAuthManagerPrivate *priv, SoupMessage *msg)
        const char *header;
        SoupAuthClass *auth_class;
        char *challenge = NULL;
-       SoupAuth *auth;
+       SoupAuth *auth = NULL;
        int i;
 
        header = auth_header_for_message (msg);
@@ -364,14 +364,14 @@ create_auth (SoupAuthManagerPrivate *priv, SoupMessage *msg)
        for (i = priv->auth_types->len - 1; i >= 0; i--) {
                auth_class = priv->auth_types->pdata[i];
                challenge = soup_auth_manager_extract_challenge (header, auth_class->scheme_name);
-               if (challenge)
+               if (!challenge)
+                       continue;
+               auth = soup_auth_new (G_TYPE_FROM_CLASS (auth_class), msg, challenge);
+               g_free (challenge);
+               if (auth)
                        break;
        }
-       if (!challenge)
-               return NULL;
 
-       auth = soup_auth_new (G_TYPE_FROM_CLASS (auth_class), msg, challenge);
-       g_free (challenge);
        return auth;
 }
 


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