Skip to content

Commit 476ba75

Browse files
authored
Merge pull request #256 from requests/issue/254
Prefer user-supplied auth credentials.
2 parents 40a0754 + 1402e53 commit 476ba75

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

requests_oauthlib/oauth2_session.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,10 @@ def request(self, method, url, data=None, headers=None, withhold_token=False,
333333
if self.auto_refresh_url:
334334
log.debug('Auto refresh is set, attempting to refresh at %s.',
335335
self.auto_refresh_url)
336-
auth = None
337-
if client_id and client_secret:
336+
337+
# We mustn't pass auth twice.
338+
auth = kwargs.pop('auth', None)
339+
if client_id and client_secret and (auth is None):
338340
log.debug('Encoding client_id "%s" with client_secret as Basic auth credentials.', client_id)
339341
auth = requests.auth.HTTPBasicAuth(client_id, client_secret)
340342
token = self.refresh_token(

0 commit comments

Comments
 (0)