2

我正在为我的网站使用 Linkedin oauth。我需要使用linkedin oAuth API 实现强制注销概念。

下面的代码我已经尝试过了,但我无法获得使用 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>");  
    }
   ?>

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

4

0 回答 0