2

I'm using Jimbo's Twitter API class to try and authorize a user (using dev.twitter's tutorial). And I keep getting the error "Failed to validate oauth signature and token".

The code I'm using create the POST request is:

$url = 'https://api.twitter.com/oauth/request_token';
$requestMethod = 'POST';

$postfields = array(
    'oauth_callback' => 'http://mysite.com'
);

$twitter = new TwitterAPIExchange($settings);
echo $twitter->buildOauth($url, $requestMethod)
             ->setPostfields($postfields)
             ->performRequest();

When I echo out the oauth_signature variable I got "bAsP6WERmBpyp%2BcFM2L6GevAjbM%3D" which looks fine I think. And I have adjusted the server clock, it made no difference.

So what is the problem? I am new to the twitter API so I feel I have made a really obvious mistake. Hopefully someone can help me :)

4

0 回答 0