本文整理汇总了PHP中Abraham\TwitterOAuth\TwitterOAuth::url方法的典型用法代码示例。如果您正苦于以下问题:PHP TwitterOAuth::url方法的具体用法?PHP TwitterOAuth::url怎么用?PHP TwitterOAuth::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Abraham\TwitterOAuth\TwitterOAuth
的用法示例。
在下文中一共展示了TwitterOAuth::url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
/**
* Redirects the user to Twitter's API login page.
*
* @see https://dev.twitter.com/web/sign-in/implementing
* @see https://twitteroauth.com/redirect.php
*/
public function login()
{
$aRequestToken = $this->getRequestToken();
if ($aRequestToken) {
$sTwitterLoginUrl = $this->_oTwitterOAth->url('oauth/authorize', ['oauth_token' => $aRequestToken['oauth_token']]);
URL::redirect($sTwitterLoginUrl);
}
return false;
}
示例2: getUrlLogin
public function getUrlLogin()
{
$connection = new TwitterOAuth($this->consumer_key, $this->consumer_secret);
$request_token = $connection->oauth('oauth/request_token', ['oauth_callback' => 'http://api.uhealth.com.br/v1/twitterCallback']);
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
return $connection->url('oauth/authorize', ['oauth_token' => $request_token['oauth_token']]);
}
示例3: getAuthorizationUrl
public function getAuthorizationUrl(array $options = [])
{
$connection = new TwitterOAuth($this->clientId, $this->clientSecret);
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => $this->redirectUri));
$options["session"]->write('twitter.request_token', $request_token);
$url = $connection->url('oauth/authenticate', array('oauth_token' => $request_token['oauth_token']));
return $url;
}
示例4: getBotAuthorizeURL
public static function getBotAuthorizeURL($route = "/")
{
$connection = new TwitterOAuth(CONSUMER_KEY_BOT, CONSUMER_SECRET_BOT);
$response = $connection->oauth("oauth/request_token", array("oauth_callback" => "http://" . $_SERVER['SERVER_NAME'] . $route));
$_SESSION['oauth_token_bot'] = $response['oauth_token'];
$_SESSION['oauth_token_secret_bot'] = $response['oauth_token_secret'];
$url = $connection->url("oauth/authorize", array("oauth_token" => $response['oauth_token']));
return $url;
}
示例5: GenerateLoginLink
function GenerateLoginLink()
{
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
$url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
return $url;
}
示例6: authorize
public function authorize()
{
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
setcookie('oauth_token', $request_token['oauth_token']);
setcookie('oauth_token_secret', $request_token['oauth_token_secret']);
$url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
header("Location: {$url}");
}
示例7: getAuthUrl
public function getAuthUrl()
{
$connection = new TwitterOAuth(self::CONSUMER_KEY, self::CONSUMER_SECRET);
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => self::OAUTH_CALLBACK));
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
$url = $connection->url('oauth/authenticate', array('oauth_token' => $request_token['oauth_token']));
return $url;
}
示例8: getLoginStartUrl
/**
* Returns twitter login start auth process
*
* @param string $redirecturl URL where to redirect after login complete
*/
public function getLoginStartUrl($redirecturl)
{
$connection = new TwitterOAuth($this->options['consumer_key'], $this->options['consumer_secret']);
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => $redirecturl));
$this->request_token = array();
$this->request_token['oauth_token'] = $request_token['oauth_token'];
$this->request_token['oauth_token_secret'] = $request_token['oauth_token_secret'];
return $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
}
示例9: getAccessToken
public function getAccessToken()
{
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
Session::put('oauth_token', $request_token['oauth_token']);
Session::put('oauth_token_secret', $request_token['oauth_token_secret']);
$url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
return $url;
}
示例10: twitter
public function twitter()
{
$connection = new TwitterOAuth(Config::get('twitter.appid'), Config::get('twitter.secret'));
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => Config::get('twitter.callback')));
$_SESSION['login_type'] = "twitter";
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
$url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
return redirect($url);
}
示例11: action_signInWithTwitter
public function action_signInWithTwitter()
{
$connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => OAUTH_CALLBACK));
//echo var_dump($request_token);
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
$url = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
header("Location: " . $url);
die;
}
示例12: authorizeURL
/**
* 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;
}
示例13: _redirectFlow
private function _redirectFlow()
{
$conn = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET);
//リクエストトークンをセットする、コールバックURKを渡す
$tokens = $conn->oauth('oauth/request_token', ['oauth_callback' => CALLBACK_URL]);
// 後で利用できるようにsessionに保存する
$_SESSION['oauth_token'] = $tokens['oauth_token'];
$_SESSION['oauth_token_secret'] = $tokens['oauth_token_secret'];
// redirect アカウントの利用を許可しますか?へ飛ばす
$authorizeUrl = $conn->url('oauth/authorize', ['oauth_token' => $tokens['oauth_token']]);
header('Location: ' . $authorizeUrl);
exit;
}
示例14: getauthorizeurl
public function getauthorizeurl()
{
$ret = null;
$twitter_oauth_callback = site_url('user/signup');
$connection = new TwitterOAuth($this->twitter_app_id, $this->twitter_api_secret);
$connection->setTimeouts(10, 15);
//To prevent timeout error
$request_token = $connection->oauth('oauth/request_token', array('oauth_callback' => $twitter_oauth_callback));
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];
$ret = $connection->url('oauth/authorize', array('oauth_token' => $request_token['oauth_token']));
return $ret;
}
示例15: _redirectFlow
private function _redirectFlow()
{
$conn = new TwitterOAuth(TWITTER_CONSUMER_KEY, TWITTER_CONSUMER_SECRET);
// 認証リクエスト用トークン発行
$tokens = $conn->oauth('oauth/request_token', ['oauth_callback' => TWITTER_CALLBACK_URL]);
// 認証リクエスト用トークンの保持
$_SESSION['tmp_twitter_oauth_token'] = $tokens['oauth_token'];
$_SESSION['tmp_twitter_oauth_token_secret'] = $tokens['oauth_token_secret'];
// Twitterの認証画面へリダイレクトさせる
$authorizeUrl = $conn->url('oauth/authorize', ['oauth_token' => $tokens['oauth_token']]);
header('Location: ' . $authorizeUrl);
exit;
}