
Originally Posted by
habuma
You don't update the existing connection. If the token is new, you remove the old connection and create a new one. I know that to work, because I've got some experimental code to do just that (experimental code that I need to dust off and make non-experimental soon...but that's a problem for another day)........
I don't see it's a good idea.
If I remove Connection from DB the only way to recreate it make almost 'full OAuth dance' flow.
Code:
org.springframework.social.connect.web
public class ConnectSupport {
......
public Connection<?> completeConnection(OAuth2ConnectionFactory<?> connectionFactory, NativeWebRequest request) {
String code = request.getParameter("code");
try {
AccessGrant accessGrant = connectionFactory.getOAuthOperations().exchangeForAccess(code, callbackUrl(request), null);
return connectionFactory.createConnection(accessGrant);
..........
I hardly think it's a good idea to send FB user with 'confirmed FB app' permissions and already installed FB app.
Having only limited info from 'signed_request', I would like update existing record for FB user with new 'auth_token', 'expired_time' values and go. I have not much experience with that stuff. That my thoughts from code and my efforts.
Dig that stuff farther...