Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6382245
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:29:54+00:00 2026-05-25T02:29:54+00:00

I am having some problems with implementing the twitter api. I am using Abraham’s

  • 0

I am having some problems with implementing the twitter api. I am using Abraham’s method to connect to Twitter but I get this error:

object(stdClass)#25 (2) {
  ["error"]=>
  string(27) "Could not authenticate you."
  ["request"]=>
  string(302) "/1/account/verify_credentials.json?oauth_consumer_key=79CrBl2oYlaATF7YOn0New&oauth_nonce=014df8945398b9605b78703829f93c45&oauth_signature=7OnRBeraaGxXgLbTNQ3%2BFdMAIPs%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1314776180&oauth_token=U7iPIyqv7IJyq1VkvKsf06KE6KQOtVDPBEwwqRjhg&oauth_version=1.0"
}

This is my code:

$to = new TwitterOAuth();
        $tok = $to->getRequestToken(CURRURL);
        $request_link = $to->getAuthorizeURL($tok);
        $_SESSION['oauth_access_token']= $tok['oauth_token'];
        $_SESSION['oauth_access_token_secret'] = $tok['oauth_token_secret'];

if ((!isset($_SESSION['oauth_access_token'])) || ($_SESSION['oauth_access_token'])=='') {

            $to = new TwitterOAuth($_SESSION['oauth_access_token'], $_SESSION['oauth_request_token_secret']);
            $token_credentials = $to->getAccessToken($_REQUEST['oauth_verifier']);
            $_SESSION['oauth_access_token'] =$token_credentials['oauth_token'];
            $_SESSION['oauth_access_token_secret'] = $token_credentials['oauth_token_secret'];
        } else {
            $connection = new TwitterOAuth($access_token['oauth_token'], $access_token['oauth_token_secret']);
            $user_info = $to->get('account/verify_credentials');

            //die(var_dump($user_info));

            $data = array(
            "twitter" => array(
                "oauth_provider" => "twitter",
                "oauth_uid" => $user_info->id,
                "first_name" => $user_info->name,
                "last_name" => "",
                "username" => $user_info->screen_name,
                "email" => "",
                "gender" => "",
                "hometown" => "",
                "location" => $user_info->location
                )
            );

            array_push($social,$data);

        }

I have been banging my head to the wall over this, so any suggestions would greatly be appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T02:29:55+00:00Added an answer on May 25, 2026 at 2:29 am

    First, when you initialize your method TwitteroAuth you’ve to pass also your consumer_key and consumer_secret that Twitter gives you.

    Second, after the getAuthorizeURL you’ve to redirect the user to the Twitter website to allow them to accept you access to their information.

    After the user allows Twitter to use its own information, Twitter redirects the user to your callback page. In your example is what contains the constant CURRURL.

    You’ll receive two new information with your URL the oauth_token and oauth_token_secret and you gonna initialize TwitterOAuth again with this, the consumer_key, consumer_secret, and theses two new parameters. TwitterOAuth(key, secret, token, token_secret)

    And only after it you’ll be able to get the user information with $user_info = $to->get('account/verify_credentials');

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some problems with a datagridview element I'm using in VS2008. This DataGridView
I having some problems implementing IOC using windsor. I have several different implementations of
I'm having some problems with the stack in java... I'm implementing quicksort using an
I'm having some problems implementing an algorithm to read a foreign process' memory. Here
I have been having some problems trying to get my PHP running. When I
I'm having some problems implementing an exception system in my program. I found somewhere
I'm having problems implementing classes in mootools since I can't use 'this' when I
I'm having some problems with implementing javascript controls in my asp.net page. I would
Related directly to this post , I am having trouble implementing some sound advice
I'm having some problems implementing a control that shows a Busy indicator, here is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.