Skip to content
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

OAuth Refresh Token Flow: Is there a standard solution available? #98

Open
richardtop opened this issue Mar 5, 2025 · 2 comments
Open

Comments

@richardtop
Copy link

Hi, I'm using Get with CreateAPI and so far the solution is working great. I've actually been using a proprietary client based on your 2017y article earlier and implemented a custom OAuth token refresh flow.

In your 2022y article, you outlined another approach to use the Get Client Delegate to execute the refresh procedure:
https://kean.blog/post/new-api-client

I'm curious whether that's still the preferred approach to use with the Get client or whether there is an off-the-shelf solution, similar to https://github.com/OAuthSwift/OAuthSwiftAlamofire to be used.

If the method in the article is the preferred one, I think it would be good to incorporate it back into the Get documentation, so that it would be accessible from within this package.

This issue is an important one, as I think, OAuth is one of the most popular authentication methods out there and this library is likely to be used with it.

@kean
Copy link
Owner

kean commented Mar 5, 2025

I'm curious whether that's still the preferred approach to use with the Get client or whether there is an off-the-shelf solution

I'm not aware of any, but, in my experience, no server has been exactly the same and I always had to use a ad-hoc solution and a framework that accommodates it.

I think it would be good to incorporate it back into the Get documentation

That's a great suggestion, but, full disclosure, I'm not actively working on this project at the moment. I would be happy to review and merge changes suggested by others.

@richardtop
Copy link
Author

Clear, then might add some docs, or even copy-paste them from your article, as I'm using it to build the client I need. Since there is another OpenAPI generator project, that pretty much works in pair with Get, that would be a great idea to have a sample for the OAuth retrier.

The ad-hoc solution in my case is just overriding a few methods in the delegate, as in your article.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants