[libsoup] Bug 788238 - Fallback to another authentication type if the current failed



commit 6a1ab1eebb64f482a949f04fc1442c13ccb55e11
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 b32ba90..62fe9c4 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]