-
Notifications
You must be signed in to change notification settings - Fork 164
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
Saving refreshToken #21
Comments
Keep an eye on this issue: https://jira.spring.io/browse/SOCIAL-263 This is a possible solution: https://jira.spring.io/browse/SOCIAL-328 |
@GabiAxel I think the problem isn't really covered by those bugs. Rather it's caused in spring-social-core here: Since Google does not give us a new refresh token, accessGrant.getRefreshToken() is null and initAccessTokens() nulls out the refreshToken used to perform the refresh. |
I had to override the buildAuthorizeUrl of the OAuth2Template class inside GoogleOAuth2Template to add a request for the Google refreshToken. That works fine. However, once the refresh token is used, the refreshToken is changed to null by the framework; after calling connection.refresh(), the refreshToken value is wiped out and there is no way to manually update the Connection object with the old reusable refreshToken before calling connectionRepository.updateConnection(connection). I want to be able to update the connection in the userconnection table to retain the old refreshToken. Is there an easy way to populate the refreshToken field without having to write extra database code to do it? Preferably I would have liked to just call a public setter method on the Connection object.
The text was updated successfully, but these errors were encountered: