當前位置: 首頁>>代碼示例>>PHP>>正文


PHP LinkedIn::generateAuthorizeUrl方法代碼示例

本文整理匯總了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;
 }
開發者ID:gaetanodanelli,項目名稱:slogin,代碼行數:17,代碼來源:linkedin.php

示例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;
 }
開發者ID:janich,項目名稱:slogin,代碼行數:24,代碼來源:linkedin.php

示例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());
 }
開發者ID:Entellus,項目名稱:red,代碼行數:19,代碼來源:home_18.php

示例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());
開發者ID:OkyJ,項目名稱:findmyjodi,代碼行數:18,代碼來源:acesslinkedindata.php

示例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();
 }
開發者ID:jelek92,項目名稱:Store,代碼行數:11,代碼來源:Auth.php

示例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;
}
開發者ID:raj4126,項目名稱:twextra,代碼行數:33,代碼來源:tw.lib.php

示例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;
開發者ID:edmarmoretti,項目名稱:i3geo,代碼行數:28,代碼來源:testLinkedinOauth.php


注:本文中的LinkedIn::generateAuthorizeUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。