I was following the vignette for the package, updated and loaded all necessary packages, seemed like it would be a pretty straight-forward process to authenticate. Instead,
I used a different wireless network (which was less secure) and this worked for me
The problem for me was that my curl was out-of-date, so it wasn't able to verify the SSL certificate it was receiving. All I had to do is update curl (simply conda update curl
if you're using anaconda) and oauth worked perfectly after that.
install.packages("base64enc") was what solved this issue for me.
Try to regenerate the consumer key and access_token keys. I also faced the similar problem. Nothing resolved my problem. But after I regenerated the keys and used the new keys its resolved and works beauty.
I tried all the suggestions here but surprisingly none worked for me. Somebody could be going through the same situation as I did so I answer with what worked for me- it seems that the problem was with direct authentication, so I followed the following steps(this requires one to have the openssl
package) installed and loaded along with the twitteR
package;
Ensure you have created your twitter API and have the consumerkey and consumerSecret codes, and preferably remain logged into twitter with your default web browser
packages <- c("twitteR", "openssl")
### checking if packages are already installed and installing if not
for(i in packages){
if(!(i %in% installed.packages()[, "Package"])){
install.packages(i)
}
library(i, character.only = TRUE) ## load packages
}
setup_twitter_oauth(consumer_key, consumer_secret) ## do not input the access_token and access_secret
This is going to open up your default browser with the successful authentication message. You can close the browser now and continue exploring tweets with R.
Faced the same problem. Then realized that I was not logged into Twitter (from default browser). Logged in to Twitter and everything worked perfectly.