OAuth Request Token and Twitter

Ok, I'm trying to use OAuth to access Twitter to be able to get a list of friends from user login. I am writing this in Perl on localhost and using the example given here:

http://www.commonmap.info/w/index.php/Oauth_perl_examples

The problem I am facing is that I get this error message in apache logs:

[Mon May 30 15:29:02 2011] [error] [client 127.0.0.1] The oauth_callback_confirmed parameter is not valid for a message of type Net :: OAuth :: RequestTokenResponse line 36

The problem seems to be related to the line:

my $response = Net::OAuth->response('request token')->from_post_body($res->content);

I tried a few things and looked all over the internet to find a solution, but I'm at a loss. Any help is greatly appreciated, and if you need more information that I did not provide, just let me know!

+3
source share
2 answers

It looks like the code expects the parameter to oauth_callback_confirmedbe returned from Twitter if it is not. oauth_callback_confirmedreturned when you specify the URL oauth_callbackin the request to get access_token. You can learn more about oauth_callbackat dev.twitter.com .

0
source

I remember that I had a somewhat similar problem, but it required a callback from me. In my case, it turned out in a different way. I had to comment

$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0A;

Although in your case this is an unprocessed version

$Net::OAuth::PROTOCOL_VERSION = Net::OAuth::PROTOCOL_VERSION_1_0;

Try changing the version.

0
source

All Articles