]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
sasl: Re-introduced XOAUTH2 in the default enabled authentication mechanism
authorSteve Holme <steve_holme@hotmail.com>
Thu, 12 Nov 2015 19:45:24 +0000 (19:45 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Thu, 12 Nov 2015 19:45:24 +0000 (19:45 +0000)
Following the fix in commit d6d58dd558 it is necessary to re-introduce
XOAUTH2 in the default enabled authentication mechanism, which was
removed in commit 7b2012f262, otherwise users will have to specify
AUTH=XOAUTH2 in the URL.

Note: OAuth 2.0 will only be used when the bearer is specified.

lib/curl_sasl.c
lib/curl_sasl.h

index dd2b6bef37d7d9d43eee1d26d7b0703aff2f293e..ad6b6090f672758dff2da693411154071953bc31 100644 (file)
@@ -1455,8 +1455,7 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn,
       }
     else
 #endif
-    if((enabledmechs & SASL_MECH_XOAUTH2) && ((conn->oauth_bearer) ||
-                                              (!conn->passwd))) {
+    if((enabledmechs & SASL_MECH_XOAUTH2) && conn->oauth_bearer) {
       mech = SASL_MECH_STRING_XOAUTH2;
       state1 = SASL_OAUTH2;
       sasl->authused = SASL_MECH_XOAUTH2;
index b54d8f46b3b5c01317bf7903b878092bd94efb65..ddf73f8f018f9894abf75f2e42cb58226335c71a 100644 (file)
@@ -52,8 +52,7 @@ struct kerberos5data;
 /* Authentication mechanism values */
 #define SASL_AUTH_NONE          0
 #define SASL_AUTH_ANY           ~0U
-#define SASL_AUTH_DEFAULT       (SASL_AUTH_ANY & \
-                                 ~(SASL_MECH_EXTERNAL | SASL_MECH_XOAUTH2))
+#define SASL_AUTH_DEFAULT       (SASL_AUTH_ANY & ~SASL_MECH_EXTERNAL)
 
 /* Authentication mechanism strings */
 #define SASL_MECH_STRING_LOGIN      "LOGIN"