在linkedin OAuth中实施强制注销

时间:2012-12-22 14:54:08

标签: api linkedin

我正在使用Linkedin oauth为我的网站工作。我需要使用linkedin oAuth API实现Force Logout Concept。

我试过下面的代码,但是我无法通过Linkedin oauth获得强制注销的实际解决方案。

<?php
 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
    $linkedInSession = $linkedin->getRequestToken();

    if(empty($linkedInSession))
    {

       $_SESSION['requestToken'] = serialize($linkedin->request_token);

       $url = $linkedin->generateAuthorizeUrl();

       $loginUrl = 'https://www.linkedin.com/secure/login?session_full_logout=&trk=hb_signout';

       echo("<script>top.location.href='".$loginUrl."'</script>");  
    }
    else
    {
        echo("<script>top.location.href='".$url."'</script>");  
    }
   ?>

如何在关联帐户中注销当前记录的会话?

0 个答案:

没有答案