requests / requests-oauthlib

OAuthlib support for Python-Requests!
https://requests-oauthlib.readthedocs.org/
ISC License
1.72k stars 424 forks source link

Add support for auto-refreshing token without refresh token #394

Closed denizdogan closed 7 months ago

denizdogan commented 4 years ago

This is a basic idea on how to fix #260 since nothing has happened to the issue in three years. Let's get a discussion going, because this is a hindrance to me in almost every OAuth2 implementation I make using this library and it's clear that lots of other people have the same issue.

So the idea is to add a new constructor parameter which I currently call auto_refresh_type, it can be either "refresh_token" (which will do exactly what it does today) or "access_token" (which will just get a new access token as you normally do).

It's not a beautiful design by any means, but I intentionally tried to keep the diff as minimal as possible without any major refactorings, which would introduce breaking changes and make it more difficult to get this functionality out there.

coveralls commented 4 years ago

Coverage Status

Coverage decreased (-0.7%) to 89.804% when pulling 1224b580b1791511af6b56c489a34054ca049306 on denizdogan:master into 29ba9afd2f0e5ae4f87ebc4ef4a133c2bbf227b4 on requests:master.

JonathanHuot commented 2 years ago

This looks amazing and probably a documentation about it and a couple of unit tests will be ideal... I know it has been long time already @denizdogan. I can also try to do this part.

denizdogan commented 2 years ago

@JonathanHuot Heheh, it's been a while indeed! I had completely forgot about this PR. I think at this point, it's better that you fill in the blanks, or maybe just rewrite it entirely :) Thanks

rohanliston commented 1 year ago

This is exactly the functionality I'm looking for. Is there any chance of this being merged in the near future?

denizdogan commented 1 year ago

@rohanliston Personally, I will not be working on adding docs or tests to this PR, I don't really use Python much anymore at all. If anyone really wants this to get merged, I would suggest maybe making a new PR with the same changes, plus some docs and a unit test.

rohanliston commented 1 year ago

@denizdogan Thanks. I'm happy to submit a fresh PR with tests/docs, but before doing so I'd like to know if the maintainers are likely to review/merge it since there appear to be questions around the status of this project.

@JonathanHuot are you able to comment on the above?

JonathanHuot commented 1 year ago

@rohanliston, I can review it when ready and integrate it when ready.

jtroussard commented 1 year ago

@JonathanHuot @rohanliston i can take some time this Sunday to review.

rohanliston commented 1 year ago

@jtroussard The project I was working on didn't go ahead and I'm now on something else. I don't think I'll have the bandwidth to come back to this, unfortunately.

jtroussard commented 7 months ago

@rohanliston Thanks for the heads up.

jtroussard commented 7 months ago

The torch has been passed to #526