setIdentityForOauthConnection(connection);
}
private void finishHandshakeAndSetRealOauthTokens(Connection connection) {
ConnectionCredentials credentials = connection.getCredentials();
OAuthEnabledConnectionProvider oauthProvider =
connectionProviderFactory.oauthEnabledConnectionProviderFromId(connection.getProviderId());
OAuthService oAuthService = oauthProvider.getOAuthService();
Token requestToken = cacheService.retrieveAndRemoveToken(credentials.getOauthToken());
Token token = oAuthService.getAccessToken(requestToken, new Verifier(credentials.getOauthVerifier()));
oauthProvider.updateCredentials(credentials, token);
}