-
-
Notifications
You must be signed in to change notification settings - Fork 421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not possible to include HTTP Basic Auth data in auto_refresh_kwargs #379
Comments
The refresh mechanism is unusable right now, as there's no way to provide the required auth. |
You can hack around this by always passing |
Is there anything wrong with my hack above? By the way, I'm not really sure if you have the same issue in mind as I did. |
This also also part of #264 |
What's the status on this? It seems like there may be solutions but I'm not smart enough to understand what is being proposed. I thought just setting the auth property to the basic authentication header would work but then of course subsequent API requests that need the access token as the authentication header fail. More details on my situation here: As is, this example in the docs (below) doesn't seem like it will actually work if the API server wants a basic authentication header for the refresh token.
|
I'm also desiring this functionality. The Xero API requires Basic Auth for the refresh token: https://developer.xero.com/documentation/oauth2/auth-flow#refresh . I'm currently having to work around auto-refresh not working by caching the token expired exceptions everywhere where the session is used. Not very elegant. The PR #433 looks like a relatively clean solution that doesn't change the API or backwards compatibility of |
Hello.
I feel that it should be possible to add
auth
(as supported by requests, in tuple form) toauto_refresh_kwargs
inOAuth2Session
. Right now both possible situations are bad:auth
toauto_refresh_kwargs
results in adding it to the body of the refresh request;auth
toOAuth2Session
directly 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 torefresh_token
will haveauth
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:
The text was updated successfully, but these errors were encountered: