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

Saving refreshToken #21

Closed
deanpeterson opened this issue Jan 7, 2013 · 2 comments
Closed

Saving refreshToken #21

deanpeterson opened this issue Jan 7, 2013 · 2 comments

Comments

@deanpeterson
Copy link

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.

@GabiAxel
Copy link
Collaborator

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

@aqtcole
Copy link

aqtcole commented Nov 19, 2015

@GabiAxel I think the problem isn't really covered by those bugs. Rather it's caused in spring-social-core here:

https://github.com/spring-projects/spring-social/blob/master/spring-social-core/src/main/java/org/springframework/social/connect/support/OAuth2Connection.java#L103

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.

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

3 participants