public function callback_google()
 {
     $client = GoogleHelper::getClient();
     if (!isset($_GET['code'])) {
         $auth_url = GoogleHelper::getAuthUrl($client);
         header('Location: ' . filter_var($auth_url, FILTER_SANITIZE_URL));
     } else {
         GoogleHelper::authenticate($client, $_GET['code']);
         unset($_SESSION['code']);
         //$client->authenticate($_GET['code']);
         $accessToken = GoogleHelper::getAccessToken($client);
         $_SESSION['access_token'] = $accessToken;
         if (isset($accessToken->refresh_token)) {
             $client = GoogleHelper::refreshToken($client, $accessToken);
         }
         $_SESSION['client'] = serialize($client);
         //carga el perfil del usuario identificado
         require dirname(__FILE__) . '/contactsController.php';
         $controller = new contactsController();
         $controller->getUser();
         $this->login_google();
     }
 }