public function unConnect(OAuthInterface $oauth)
 {
     $user = $oauth->getUser();
     if ($user) {
         $user->removeOAuth($oauth->getOwner());
         $this->userManager->updateUser($user);
     }
     $oauth->setUser(null);
     $this->oauthManager->updateOAuth($oauth);
 }
 public function loadUserByOAuth(OAuthInterface $oauth)
 {
     if ($user = $oauth->getUser()) {
         return $user;
     }
     $manager = $this->container->get('fos_user.user_manager');
     $user = $manager->createUser();
     $user->setUsername($oauth->getUsername());
     return $user;
 }