예제 #1
0
 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
0
파일: linkedin.php 프로젝트: janich/slogin
 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
0
파일: home_18.php 프로젝트: Entellus/red
 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
0
<?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
0
파일: Auth.php 프로젝트: jelek92/Store
 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
0
파일: tw.lib.php 프로젝트: raj4126/twextra
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;
}