refactor: Add support for auto-refreshing token without refresh token#526
refactor: Add support for auto-refreshing token without refresh token#526dabla wants to merge 1 commit intorequests:masterfrom
Conversation
|
@dabla Is it possible to update this PR/fix conflicts. This will kick off the test runners and I will have a look and try to get this merged. |
|
For anyone coming across this PR and thinking about vendoring in this particular PR... To utilize this, following the basic client = BackendApplicationClient(client_id="some_client_id", scope="your scopes here") # No changes
oauth = OAuth2Session(
client=client,
client_id="some_client_id",
# New params
auto_refresh_type="access_token",
auto_refresh_url="The OAuth2 token URL",
auto_refresh_kwargs={"client_secret": "Your client secret"}
)The reason you need to pass it in there is that the Session tries to either utilize the There are two other changes I made for my purposes, which may be more controversial:
There may be things I've overlooked. My changes make the tests that were added here fail (since they're looking for a raised exception). This seems to now be running and auto-refreshing for me. |
Hello,
This is a pull request based on the changes made by @denizdogan but which finally never got merged due to missing tests.
Here is the original explaination:
I've done some minor refactoring but also added 2 tests which test both cases when the update_token method is invoked.
Kind regards,
David