/**
  * Authorize URL
  *
  * Generates an authorization URL to start OAuth 2 flow.
  *
  * @return string
  */
 public function authorizeURL()
 {
     $helper = $this->fb->getRedirectLoginHelper();
     $permissions = array('user_posts', 'public_profile', 'email');
     $url = $helper->getLoginUrl(Utility::buildFullLink($this->config, false, 'session/callback/facebook'), $permissions);
     return $url;
 }
 /**
  * Generate Authorization URL
  *
  * Generate an authorization URL twitter.
  *
  * @return string
  * @throws Exception
  */
 public function authorizeURL()
 {
     $twitter = new TwitterOAuth($this->config->get('twitter', 'consumer'), $this->config->get('twitter', 'secret'));
     $twitter->setDecodeJsonAsArray(true);
     $requestToken = $twitter->oauth('oauth/request_token', array('oauth_callback' => Utility::buildFullLink($this->config, false, 'session/callback/twitter')));
     if ($requestToken['oauth_callback_confirmed'] != true) {
         throw new Exception("OAuth Callback was not confirmed.");
     }
     $this->session->setTMP('twitter_request_token', $requestToken);
     $url = $twitter->url('oauth/authorize', array('oauth_token' => $this->session->getTMP('twitter_request_token')['oauth_token']));
     return $url;
 }