-
Notifications
You must be signed in to change notification settings - Fork 941
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
[5.x] Add refreshToken
method
#675
Conversation
refreshToken
method
Does this code work for every first-party supported OAuth2 provider? |
Marking as draft pending response. |
Give me 5 days, I will test them all. |
Bitbucket✅ Works well. Slack✅ Works well. ✅ Works well. GitLab✅ Works well. ✅ Works well. Note: to get a refresh token , you must add ✅ Would work well. I've not been able to create an application authorized to receive refresh tokens. It's reserved for a limited number of partners. But it would work. The endpoint expects the same request body parameters as those sent by the proposed Facebook doesn’t provide refresh tokens. The GitHubFor OAuth Apps, access tokens don’t expire. Refresh tokens can only be enabled for GitHub Apps. The |
I facing this problem
-> Can you help me to solve this problem |
@NileshS-RSW report this issue to the socialite providers repo. |
apple is broken too because of this update |
Okta is broken as well |
Seems like this broke a lot of things. Any chance this might get reverted? @taylorotwell edit: nevermind. seems like there's already good progress on fixing the providers from socialite/providers. |
Hey @cosmastech, It's unfortunate that the update affected some third-party providers. However, I believe it's important to be able to evolve Socialite without being restricted by third-party providers. You can submit a Pull Request to SocialiteProviders/Providers. The required change is quite straightforward: the In the meantime, while waiting for your PR, or someone else's, to be accepted, you can do this:
|
Thanks for the reply @antoinelame. I did lock the socialite version on our app. That said, the solution for Okta provider wasn't that Not an intentional BC by any stretch of the imagination, and surprised that I've never come across a problem that like this before in the open-source world (as it seems like it would be common that a parent class' new method name might clash with a name that a child class chose). Thanks for your contribution! |
This PR introduces a
refreshToken
method for OAuth 2.0 providers.Typically, access tokens are updated in the database each time a user logs in. However, this approach may not be adequate for applications that perform actions on behalf of users, such as fetching data from social channels. There are scenarios where the user's session outlasts the token's validity, or where the application needs to use the token without the user's active login.
To address this, the proposed
refreshToken
method enables the application to refresh access tokens at any time using stored refresh tokens.The method returns an instance of the
Token
class, which includes the refreshed access token, refresh token, expiration duration, and scope.