Unverified Commit 6f5ef24f authored by Johannes Schindelin's avatar Johannes Schindelin Committed by Daniel Stenberg
Browse files

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: default avatarJohannes Schindelin <johannes.schindelin@gmx.de>
Closes #2754
parent df57b439
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);