您的凭据不允许访问此资源[code] => 220

时间:2014-02-14 10:02:27

标签: magento magento-1.7 magento-1.8 magento-1.5 magento-1.6

我使用twitter登录magento i配置所有内容但是当获取用户信息时会出现以下错误。您的凭据不允许访问此资源[code] => 220.如果某个机构面临这类问题,那么请帮助我并提前感谢。 我的代码是

$CONSUMER_KEY='xxxxxxxxxxxxxxxxx';
$CONSUMER_SECRET='xxxxxxxxxxxxxxxxxxxxxx';
$OAUTH_CALLBACK='http://demo004.fmeaddons.com';

session_start();
$twitteroauth = new TwitterOAuth($CONSUMER_KEY, $CONSUMER_SECRET);
$request_token = $twitteroauth->getRequestToken($OAUTH_CALLBACK);
$_SESSION['oauth_token'] = $request_token['oauth_token'];
$_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret'];

if($twitteroauth->http_code==200){
    $url = $twitteroauth->getAuthorizeURL($request_token['oauth_token']);
    echo $url;
    $twitteroauth = new TwitterOAuth($CONSUMER_KEY, $CONSUMER_SECRET, $_SESSION['oauth_token'], $_SESSION['oauth_token_secret']);
    $access_token = $twitteroauth->getAccessToken($_GET['oauth_verifier']); $_SESSION['access_token'] = $access_token;
    $user_info = $twitteroauth->get('account/verify_credentials');
    print_r($user_info);
} else {
    die('Something wrong happened.');
}

0 个答案:

没有答案