-
Notifications
You must be signed in to change notification settings - Fork 54
PROPOSAL: Implement refresh token functionality #121
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #121 +/- ##
==========================================
- Coverage 82.98% 79.19% -3.79%
==========================================
Files 63 63
Lines 852 817 -35
==========================================
- Hits 707 647 -60
- Misses 145 170 +25
🚀 New features to boost your workflow:
|
|
IIRC the original issue was that |
|
Yes, if there is a good likelihood that #122 will be adopted, I definitely think I could work off that. Let me give it a shot. |
|
Good, I just merged it |
… callback URL; currently not testable because it's permanently 'over capacity'
|
@fpseverino here's the latest iteration. With One potentially problematic element I now see is the new |
Yeah, there are still a couple of breaking changes |
Ok, so, the second one is easy enough to fix, you just have to make a little For the first one, technically if we add Let me know if you're still interested and if you think it's worth adding these changes now, or waiting for the first alpha release of Vapor 5 and preparing a new major release of Imperial (I can't tell you when the alpha of Vapor 5 will be released, though). |
|
Thanks for looking into this! Would be happy to make those changes. |
EDITED 2025-11-09
This PR features a proposed implementation of refresh token functionality. Unfortunately, to do so, it had to make architectural changes that may not be acceptable to the maintainers.
The fundamental problem I was facing is that:
FederatedServicedoing the refresh to initiate the refreshing.So the code to some extent needed to punch a hole in the existing abstractions.
Usage
Client configuration
A client wishing to use the refresh functionality needs to store a handle to the service in an accessible location:
Refreshing
Clients needs to test calls for authorization failures. On failure, they need to refresh their access token and retry their request: