requests-oauthlib icon indicating copy to clipboard operation
requests-oauthlib copied to clipboard

Add support for auto-refreshing token without refresh token

Open denizdogan opened this issue 5 years ago • 9 comments

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.

denizdogan avatar Jan 09 '20 14:01 denizdogan

Coverage Status

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

coveralls avatar Jan 09 '20 14:01 coveralls

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.

JonathanHuot avatar Feb 18 '22 22:02 JonathanHuot

@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

denizdogan avatar Feb 18 '22 22:02 denizdogan

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

rohanliston avatar Jun 06 '23 05:06 rohanliston

@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.

denizdogan avatar Jun 06 '23 10:06 denizdogan

@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?

rohanliston avatar Jun 07 '23 01:06 rohanliston

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

JonathanHuot avatar Jun 07 '23 06:06 JonathanHuot

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

jtroussard avatar Jul 14 '23 16:07 jtroussard

@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.

rohanliston avatar Jul 17 '23 05:07 rohanliston

@rohanliston Thanks for the heads up.

jtroussard avatar Mar 23 '24 22:03 jtroussard

The torch has been passed to #526

jtroussard avatar Mar 23 '24 23:03 jtroussard