From 6f5ef24f068a86d0f61ce39f674462128c1743d1 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Fri, 20 Jul 2018 18:17:43 +0200 Subject: 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 --- lib/http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/http.c b/lib/http.c index 34565590f..bc1f85850 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); -- cgit v1.2.1