linkedin Import Resume 不工作(保持加载)
linkedin Import Resume is not working ( keeps Loading )
我有 website 的 cakephp 框架并与 linkedin api 集成。网站确实具有导入简历功能,并在编辑个人资料页面中存储用户详细信息(从 linkedin 导入)。
我有 indexController,它的动作是这样的:-
public function linkedinlogin()
{
if (isset($_GET['oauth_problem']))
{
if (isset($_SESSION['requestToken']))
{
unset($_SESSION['requestToken']);
}
if (isset($_SESSION['oauth_verifier']))
{
unset($_SESSION['oauth_verifier']);
}
if (isset($_SESSION['oauth_access_token']))
{
unset($_SESSION['oauth_access_token']);
}
$this->redirect("registration");
exit;
}
//$this->autoRender = false;
if (session_status() == PHP_SESSION_NONE)
{
session_start();
}
$this->set('PageHeading', __('Linkedin Login'));
$config['base_url'] = 'http://upitchnew.inheritxserver.net/index/registration';
if (isset($_SESSION['user_id']))
{
$config['callback_url'] = 'http://upitchnew.inheritxserver.net/index/linkedinlogin?tc_id=' . $_SESSION['user_id'] . '&tc_id1=' . $_SESSION['user_ids'];
}
else
{
$config['callback_url'] = 'http://upitchnew.inheritxserver.net/index/linkedinlogin?tc_id=' . $_REQUEST['tc_id'] . '&tc_id1=' . $_REQUEST['tc_id1'];
}
$config['linkedin_access'] = 'linkedin_access';//LinkdingAccess key
$config['linkedin_secret'] = 'linkedin_secret';//Linkdin Scret key
//=require('../Vendor/linkedin/OAuth.php');
require('../Vendor/linkedin/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']);
if (isset($_REQUEST['oauth_verifier']))
{
$_SESSION['oauth_verifier'] = $_REQUEST['oauth_verifier'];
if (isset($_SESSION['requestToken']))
{
$linkedin->request_token = unserialize($_SESSION['requestToken']);
}
$linkedin->oauth_verifier = $_SESSION['oauth_verifier'];
$linkedin->getAccessToken($_REQUEST['oauth_verifier']);
$_SESSION['oauth_access_token'] = serialize($linkedin->access_token);
$this->redirect($config['callback_url']);
//header("Location: " . $config['callback_url']);
exit();
}
else
{
if (isset($_SESSION['requestToken']) && $_SESSION['requestToken'] != '')
{
if (isset($_SESSION['oauth_access_token']) && $_SESSION['oauth_access_token'] != '')
{
$linkedin->request_token = unserialize($_SESSION['requestToken']);
$linkedin->oauth_verifier = $_SESSION['oauth_verifier'];
$linkedin->access_token = unserialize($_SESSION['oauth_access_token']);
}
else
{
//$linkedin->debug = true;
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
// echo '<script>window.location.href="'.$linkedin->generateAuthorizeUrl().'"</script>';
//header("Location: " . $linkedin->generateAuthorizeUrl());
exit();
}
}
else
{
//$linkedin->debug = true;
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
//echo '<script>window.location.href="'.$linkedin->generateAuthorizeUrl().'"</script>';
//header("Location: " . $linkedin->generateAuthorizeUrl());
exit();
}
}
}
一旦您点击导入恢复按钮就会调用此操作,而不是使用 linkedin 页面加载登录,页面会继续加载并且不会重定向到 (linkedin) 登录页面。
generateAuthorizeUrl() 同时调用了:-
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
generateAuthorizeUrl 函数是这样的:-
function generateAuthorizeUrl()
{
if (isset($_SESSION['user_id']))
{
$this->user_id = $_SESSION['user_id'];
}
if (isset($_SESSION['user_ids']))
{
$this->user_ids = $_SESSION['user_ids'];
}
$consumer = $this->consumer;
$request_token = $this->request_token;
return $this->authorize_path . "?oauth_token=" . $request_token->key . "&tc_id=" . $this->user_id . "&tc_id1=" . $this->user_ids;
}
如有任何帮助,我们将不胜感激。
伙计!!糟透了!这是防火墙问题 linkedin 在处理导入用户详细信息时使用 https://api.linkedin.com/uas/oauth/authorize?oauth_token=auth_token url! url 被 Sophos 证券封锁。
所以它既没有显示任何错误也没有显示任何其他内容只是 继续加载..
问题已解决。
我有 website 的 cakephp 框架并与 linkedin api 集成。网站确实具有导入简历功能,并在编辑个人资料页面中存储用户详细信息(从 linkedin 导入)。
我有 indexController,它的动作是这样的:-
public function linkedinlogin()
{
if (isset($_GET['oauth_problem']))
{
if (isset($_SESSION['requestToken']))
{
unset($_SESSION['requestToken']);
}
if (isset($_SESSION['oauth_verifier']))
{
unset($_SESSION['oauth_verifier']);
}
if (isset($_SESSION['oauth_access_token']))
{
unset($_SESSION['oauth_access_token']);
}
$this->redirect("registration");
exit;
}
//$this->autoRender = false;
if (session_status() == PHP_SESSION_NONE)
{
session_start();
}
$this->set('PageHeading', __('Linkedin Login'));
$config['base_url'] = 'http://upitchnew.inheritxserver.net/index/registration';
if (isset($_SESSION['user_id']))
{
$config['callback_url'] = 'http://upitchnew.inheritxserver.net/index/linkedinlogin?tc_id=' . $_SESSION['user_id'] . '&tc_id1=' . $_SESSION['user_ids'];
}
else
{
$config['callback_url'] = 'http://upitchnew.inheritxserver.net/index/linkedinlogin?tc_id=' . $_REQUEST['tc_id'] . '&tc_id1=' . $_REQUEST['tc_id1'];
}
$config['linkedin_access'] = 'linkedin_access';//LinkdingAccess key
$config['linkedin_secret'] = 'linkedin_secret';//Linkdin Scret key
//=require('../Vendor/linkedin/OAuth.php');
require('../Vendor/linkedin/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']);
if (isset($_REQUEST['oauth_verifier']))
{
$_SESSION['oauth_verifier'] = $_REQUEST['oauth_verifier'];
if (isset($_SESSION['requestToken']))
{
$linkedin->request_token = unserialize($_SESSION['requestToken']);
}
$linkedin->oauth_verifier = $_SESSION['oauth_verifier'];
$linkedin->getAccessToken($_REQUEST['oauth_verifier']);
$_SESSION['oauth_access_token'] = serialize($linkedin->access_token);
$this->redirect($config['callback_url']);
//header("Location: " . $config['callback_url']);
exit();
}
else
{
if (isset($_SESSION['requestToken']) && $_SESSION['requestToken'] != '')
{
if (isset($_SESSION['oauth_access_token']) && $_SESSION['oauth_access_token'] != '')
{
$linkedin->request_token = unserialize($_SESSION['requestToken']);
$linkedin->oauth_verifier = $_SESSION['oauth_verifier'];
$linkedin->access_token = unserialize($_SESSION['oauth_access_token']);
}
else
{
//$linkedin->debug = true;
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
// echo '<script>window.location.href="'.$linkedin->generateAuthorizeUrl().'"</script>';
//header("Location: " . $linkedin->generateAuthorizeUrl());
exit();
}
}
else
{
//$linkedin->debug = true;
$linkedin->getRequestToken();
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
//echo '<script>window.location.href="'.$linkedin->generateAuthorizeUrl().'"</script>';
//header("Location: " . $linkedin->generateAuthorizeUrl());
exit();
}
}
}
一旦您点击导入恢复按钮就会调用此操作,而不是使用 linkedin 页面加载登录,页面会继续加载并且不会重定向到 (linkedin) 登录页面。
generateAuthorizeUrl() 同时调用了:-
$_SESSION['requestToken'] = serialize($linkedin->request_token);
$this->redirect($linkedin->generateAuthorizeUrl());
generateAuthorizeUrl 函数是这样的:-
function generateAuthorizeUrl()
{
if (isset($_SESSION['user_id']))
{
$this->user_id = $_SESSION['user_id'];
}
if (isset($_SESSION['user_ids']))
{
$this->user_ids = $_SESSION['user_ids'];
}
$consumer = $this->consumer;
$request_token = $this->request_token;
return $this->authorize_path . "?oauth_token=" . $request_token->key . "&tc_id=" . $this->user_id . "&tc_id1=" . $this->user_ids;
}
如有任何帮助,我们将不胜感激。
伙计!!糟透了!这是防火墙问题 linkedin 在处理导入用户详细信息时使用 https://api.linkedin.com/uas/oauth/authorize?oauth_token=auth_token url! url 被 Sophos 证券封锁。
所以它既没有显示任何错误也没有显示任何其他内容只是 继续加载..
问题已解决。