-
-
Notifications
You must be signed in to change notification settings - Fork 427
Open
Description
Hello.
I feel that it should be possible to add auth (as supported by requests, in tuple form) to auto_refresh_kwargs in OAuth2Session. Right now both possible situations are bad:
- adding
authtoauto_refresh_kwargsresults in adding it to the body of the refresh request; - adding
authtoOAuth2Sessiondirectly would result in it being passed to all subsequent requests made with that session, which is not what I want.
I would like to add it to OAuth2Session in the way that would ensure that any automatic future calls to refresh_token will have auth passed as well, so it would end up being passed to requests and handled as HTTP Basic Auth.
PS A workaround to do it would be, for example:
def wrap(func):
def wrapper(*args, **kwargs):
kwargs['auth'] = ('user', 'password')
return func(*args, **kwargs)
return wrapper
session.refresh_token = wrap(session.refresh_token)
Metadata
Metadata
Assignees
Labels
No labels