[twitteR-users] ROAuth twitteR trouble

Ian Cook ianmcook at gmail.com
Fri Feb 24 13:47:55 PST 2012


Thanks for the quick reply.  Looking forward to the fix.

Ian

On Fri, Feb 24, 2012 at 4:45 PM, Jeff Gentry <gentrj at hexdump.org> wrote:

> This is my fault, I broke the handshakes w/ 0.9.1. I'm hoping to fix it
> this weekend.
>
>
> On Fri, 24 Feb 2012, Ian Cook wrote:
>
>  Hi,
>>
>> I'm trying without success to perform an OAuth handshake with the Twitter
>> API, following the basic steps outlined in section 6 of the twitteR
>> vignette, with a few steps added to capture the HTTP in Fiddler (for
>> debugging) and to accept the SSL connection:
>>
>> library(ROAuth)
>> options( RCurlOptions = list(verbose = TRUE, proxy = "127.0.0.1:8888"))
>>
>> requestURL     <- "https://api.twitter.com/**oauth/request_token<https://api.twitter.com/oauth/request_token>
>> "
>> authURL        <- "https://api.twitter.com/**oauth/authorize<https://api.twitter.com/oauth/authorize>
>> "
>> accessURL      <- "https://api.twitter.com/**oauth/access_token<https://api.twitter.com/oauth/access_token>
>> "
>> consumerKey    <- "(my consumer key)"
>> consumerSecret <- "(my consumer secret)"
>>
>> cred <- OAuthFactory$new(consumerKey=**consumerKey,
>>                            consumerSecret=consumerSecret,
>>                            requestURL=requestURL,
>>                            accessURL=accessURL,
>>                            authURL=authURL)
>>
>> download.file(url="http://**curl.haxx.se/ca/cacert.pem<http://curl.haxx.se/ca/cacert.pem>
>> ",
>> destfile="cacert.perm")
>> cred$handshake(cainfo="cacert.**pem")
>>
>>
>> ROAuth gives me the error:
>>
>> Error in cred$handshake(cainfo = "cacert.pem") :
>>  Invalid response from site, please check your consumerKey and
>> consumerSecret and try again.
>>
>>
>> Fiddler shows me that the response is a 401 with the message: "Failed to
>> validate oauth signature and token"
>>
>> Any clues?  There are some suggestions from users on Stack Overflow that
>> it
>> may be a problem with the order of the POST fields, or with a timestamp
>> that is not the correct time.  I believe I have ruled out the timestamp
>> possibility.
>>
>> I'm using ROAuth 0.9.1.
>>
>> Thanks,
>> Ian
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hexdump.org/pipermail/twitter-users-hexdump.org/attachments/20120224/cc3f51be/attachment.htm>


More information about the twitteR-users mailing list