本文整理汇总了PHP中LinkedIn::generateAuthorizeUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP LinkedIn::generateAuthorizeUrl方法的具体用法?PHP LinkedIn::generateAuthorizeUrl怎么用?PHP LinkedIn::generateAuthorizeUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LinkedIn
的用法示例。
在下文中一共展示了LinkedIn::generateAuthorizeUrl方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onSloginAuth
public function onSloginAuth()
{
$redirect = JURI::base() . '?option=com_slogin&task=check&plugin=linkedin';
$app = JFactory::getApplication('site');
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($this->params->get('api_key'), $this->params->get('secret_key'), $redirect);
//$linkedin->debug = true;
# Now we retrieve a request token. It will be set as $linkedin->request_token
$linkedin->getRequestToken();
if (empty($linkedin->request_token)) {
echo 'Error - empty access tocken';
exit;
}
$app->setUserState('requestToken', serialize($linkedin->request_token));
$url = $linkedin->generateAuthorizeUrl();
return $url;
}
示例2: onSloginAuth
public function onSloginAuth()
{
if ($this->params->get('allow_remote_check', 1)) {
$remotelUrl = JURI::getInstance($_SERVER['HTTP_REFERER'])->toString(array('host'));
$localUrl = JURI::getInstance()->toString(array('host'));
if ($remotelUrl != $localUrl) {
die('Remote authorization not allowed');
}
}
$redirect = JURI::base() . '?option=com_slogin&task=check&plugin=linkedin';
$app = JFactory::getApplication('site');
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($this->params->get('api_key'), $this->params->get('secret_key'), $redirect);
//$linkedin->debug = true;
# Now we retrieve a request token. It will be set as $linkedin->request_token
$linkedin->getRequestToken();
if (empty($linkedin->request_token)) {
echo 'Error - empty access tocken';
exit;
}
$app->setUserState('requestToken', serialize($linkedin->request_token));
$url = $linkedin->generateAuthorizeUrl();
return $url;
}
示例3: linkedin
public function linkedin()
{
session_start();
$this->load->helper('url');
$this->load->library('linkedin');
$config['base_url'] = base_url('home/linkedin');
$config['callback_url'] = base_url('home/demo');
$config['linkedin_access'] = '752gpjkt6d55ne';
$config['linkedin_secret'] = 'y9VajltKjmVYRfXw';
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($config['linkedin_access'], $config['linkedin_secret'], $config['callback_url']);
//$linkedin->debug = true;
# Now we retrieve a request token. It will be set as $linkedin->request_token
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
# With a request token in hand, we can generate an authorization URL, which we'll direct the user to
//echo "Authorization URL: " . $linkedin->generateAuthorizeUrl() . "\n\n";
header("Location: " . $linkedin->generateAuthorizeUrl());
}
示例4: LinkedIn
<?php
session_start();
include 'lib/myclass.php';
$config['base_url'] = $obj->SITEURL . 'acesslinkeddata.php';
$config['callback_url'] = $obj->SITEURL . 'demo.php';
$config['linkedin_access'] = '75vkqc3tq7hrwp';
$config['linkedin_secret'] = 'VpK3l3fMS3hMna7f';
include_once "linkedin.php";
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($config['linkedin_access'], $config['linkedin_secret'], $config['callback_url']);
//$linkedin->debug = true;
# Now we retrieve a request token. It will be set as $linkedin->request_token
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
# With a request token in hand, we can generate an authorization URL, which we'll direct the user to
//echo "Authorization URL: " . $linkedin->generateAuthorizeUrl() . "\n\n";
header("Location:" . $linkedin->generateAuthorizeUrl());
示例5: get_linkedin_url
public function get_linkedin_url()
{
$config['base_url'] = base_url('auth/get_linkedin_url');
$config['callback_url'] = base_url('auth/linkedin_login');
$config['linkedin_access'] = '78iwuorjnrw04c';
$config['linkedin_secret'] = 'J05AYZ236vVmIc3e';
$linkedin = new LinkedIn($config['linkedin_access'], $config['linkedin_secret'], $config['callback_url']);
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
echo $linkedin->generateAuthorizeUrl();
}
示例6: ln_page1
function ln_page1($prefix, $message)
{
//configuration parameters:
$config_params = Config::getConfigParams();
$hostname = $config_params['hostname'];
$linkedin_access = $config_params['linkedin_access'];
$linkedin_secret = $config_params['linkedin_secret'];
$docroot = $config_params['docroot'];
$debug = $config_params['debug'];
$script_path = __FUNCTION__;
if (session_id() == "") {
session_start();
}
include_once $docroot . "/linkedin/linkedin.php";
$config['base_url'] = "{$hostname}/linkedin/page1.php";
$config['callback_url'] = "{$hostname}/linkedin/page2.php";
$config['linkedin_access'] = $linkedin_access;
$config['linkedin_secret'] = $linkedin_secret;
logger($script_path . " Ln/Top: ");
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($config['linkedin_access'], $config['linkedin_secret'], $config['callback_url']);
//$linkedin->debug = true;
# Now we retrieve a request token. It will be set as $linkedin->request_token
$linkedin->getRequestToken();
logger($script_path . " request_token: ", $linkedin->request_token);
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$_SESSION['message'] = $message;
//
$_SESSION['prefix'] = $prefix;
# With a request token in hand, we can generate an authorization URL, which we'll direct the user to
header("Location: " . $linkedin->generateAuthorizeUrl());
exit;
}
示例7: dirname
<?php
require_once 'linkedin.php';
include dirname(__FILE__) . "/../../ms_configura.php";
$consumer_key = $linkedinoauth["consumerkey"];
$consumer_secret = $linkedinoauth["consumersecret"];
echo "<pre>";
# First step is to initialize with your consumer key and secret. We'll use an out-of-band oauth_callback
$linkedin = new LinkedIn($consumer_key, $consumer_secret, "oob");
$linkedin->debug = true;
# Now we retrieve a request token. It will be set as $linkedin->request_token
$linkedin->getRequestToken();
# With a request token in hand, we can generate an authorization URL, which we'll direct the user to
echo "Authorization URL: " . $linkedin->generateAuthorizeUrl() . "\n\n";
# After logging in, the user will be presented with an OAuth Verifier, which you would then ask the member to enter in a UI you present. Once you have the OAuth verifier, set it here:
echo "Enter OAuth Verifier:\n";
$handle = fopen("php://stdin", "r");
$oauth_verifier = trim(fgets($handle));
$linkedin->getAccessToken($oauth_verifier);
# You now have a $linkedin->access_token and can make calls on behalf of the current member
$xml_response = $linkedin->getProfile("~:(id,first-name,last-name,headline,picture-url)");
echo $xml_response;
# Let's set our status
$xml_response2 = $linkedin->setStatus("setting my status using the LinkedIn API.");
echo $xml_response2;
# Let's do a search!
$search_response = $linkedin->search("?company=Google&count=10");
echo $search_response;