开发者

OAuth Request Token and Twitter

Okay, I am trying to use OAuth to access Twitter to be able to get a list of friends from the user logging in. I am writing this in Perl on localhost and using the example seen here:

http://www.commonmap.info/w/index.ph开发者_如何学运维p/Oauth_perl_examples

The problem that I am having is that I receive this error message in apache logs:

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

It appears to be having the problem at the line:

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

I have tried several things and looked all around the web to find a solution but am at a loss. Any help is greatly appreciated and if you need anymore info that I didn't specify just let me know!


It sounds like the code is expecting an oauth_callback_confirmed parameter to be returned from Twitter when there isn't one. oauth_callback_confirmed is returned when you specify an oauth_callback URL in the request to get the access_token. You can read more about oauth_callback on dev.twitter.com.


I remember I was having a somewhat similar problem, but it was requiring me to supply a callback. In my case it turned to be a different protocol flavor. I had to comment out

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

Though in your case it is non-revised version

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

Try switching version.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜