3

I am using twitter login for magento i configure everything but when get the user informations the give the following error.Your credentials do not allow access to this resource [code] => 220. if some body face this type of problem then help me and thanks in advance. my code is

$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.');
}
jnersn
  • 384
  • 1
  • 3
  • 14
user247217
  • 394
  • 1
  • 9
  • Have you got any where with this problem? I'm in the same boat. – cwiggo Jul 06 '15 at 13:56
  • Possible duplicate of [API - Error 202 "Your credentials do not allow access to this resource"](https://stackoverflow.com/questions/23195832/api-error-202-your-credentials-do-not-allow-access-to-this-resource) – Naresh Mar 27 '19 at 06:48

1 Answers1

0

Make sure your keys were created with the correct permissions. You can check this in the "Keys and tokens" section of your Twitter developer dashboard:

Screenshot of Keys and tokens

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257