From: Johannes Schindelin Date: Fri, 20 Jul 2018 16:17:43 +0000 (+0200) Subject: auth: pick Bearer authentication whenever a token is available X-Git-Tag: curl-7_61_1~126 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6f5ef24f068a86d0f61ce39f674462128c1743d1;p=thirdparty%2Fcurl.git auth: pick Bearer authentication whenever a token is available So far, the code tries to pick an authentication method only if user/password credentials are available, which is not the case for Bearer authentictation... Signed-off-by: Johannes Schindelin Closes #2754 --- diff --git a/lib/http.c b/lib/http.c index 34565590f5..bc1f858501 100644 --- a/lib/http.c +++ b/lib/http.c @@ -520,7 +520,7 @@ CURLcode Curl_http_auth_act(struct connectdata *conn) if(data->state.authproblem) return data->set.http_fail_on_error?CURLE_HTTP_RETURNED_ERROR:CURLE_OK; - if(conn->bits.user_passwd && + if((conn->bits.user_passwd || conn->oauth_bearer) && ((data->req.httpcode == 401) || (conn->bits.authneg && data->req.httpcode < 300))) { pickhost = pickoneauth(&data->state.authhost, authmask);