private void updateConnections(SocialAuthenticationService<?> authService, SocialAuthenticationToken token, Authentication success) {
if (updateConnections) {
String userId = ((SocialUserDetails)success.getPrincipal()).getUserId();
Connection<?> connection = token.getConnection();
ConnectionRepository repo = getUsersConnectionRepository().createConnectionRepository(userId);
repo.updateConnection(connection);
}
}
private void addSignInAttempt(HttpSession session, Connection<?> connection) {
session.setAttribute(ProviderSignInAttempt.SESSION_ATTRIBUTE, new ProviderSignInAttempt(connection, authServiceLocator, usersConnectionRepository));