mirror of
https://github.com/moparisthebest/curl
synced 2024-11-11 03:55:03 -05:00
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 <johannes.schindelin@gmx.de> Closes #2754
This commit is contained in:
parent
df57b439f4
commit
6f5ef24f06
@ -520,7 +520,7 @@ CURLcode Curl_http_auth_act(struct connectdata *conn)
|
|||||||
if(data->state.authproblem)
|
if(data->state.authproblem)
|
||||||
return data->set.http_fail_on_error?CURLE_HTTP_RETURNED_ERROR:CURLE_OK;
|
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) ||
|
((data->req.httpcode == 401) ||
|
||||||
(conn->bits.authneg && data->req.httpcode < 300))) {
|
(conn->bits.authneg && data->req.httpcode < 300))) {
|
||||||
pickhost = pickoneauth(&data->state.authhost, authmask);
|
pickhost = pickoneauth(&data->state.authhost, authmask);
|
||||||
|
Loading…
Reference in New Issue
Block a user