Error in check_twitter_oauth() : OAuth authentication error:

1.4k Views Asked by At

I am getting the below setup_twitter_oauth() error repeatedly when I am trying to set up OAuth authorization for twitteR

> setup_twitter_oauth("XXXXXXXXXX", "XXXXXXXXX", "XXXXXX", "XXXXXXXX")
[1] "Using direct authentication"
Error in check_twitter_oauth() : OAuth authentication error:
This most likely means that you have incorrectly called setup_twitter_oauth()'

Will really appreciate if somebody can help on this issue?

I came across this helpful post from Github by JeffGentry but installing twitteR_1.1.8 automatically installs httr_0.6.1 instead of httr_0.6.0

Error in check_twitter_oauth() : OAuth authentication error: #67

I tried removing the default httr_0.6.1 package and download and install httr_0.6.0 from the below link but of no luck. It gives me the following error:

> install.packages("http://ftp.iitm.ac.in/cran/src/contrib/Archive/httr/httr_0.6.0.tar.gz", repos=NULL, type="source")
Installing package into ‘C:/Users/SO310400/Documents/R/win-library/3.1’
(as ‘lib’ is unspecified)
trying URL 'http://ftp.iitm.ac.in/cran/src/contrib/Archive/httr/httr_0.6.0.tar.gz'
Content type 'application/x-gzip' length 247298 bytes (241 Kb)
opened URL
downloaded 241 Kb

* installing *source* package 'httr' ...
** package 'httr' successfully unpacked and MD5 sums checked
** libs
Warning: running command 'make -f "C:/Users/SO310400/R/R-3.1.2/etc/i386/Makeconf" -f "C:/Users/SO310400/R/R-3.1.2/share/make/winshlib.mk" SHLIB="httr.dll" OBJECTS="writer.o"' had status 127
ERROR: compilation failed for package 'httr'
* removing 'C:/Users/SO310400/Documents/R/win-library/3.1/httr'
Warning in install.packages :
  running command '"C:/Users/SO310400/R/R-3.1.2/bin/i386/R" CMD INSTALL -l "C:\Users\SO310400\Documents\R\win-library\3.1" "C:/Users/SO310400/AppData/Local/Temp/RtmpeMm13f/downloaded_packages/httr_0.6.0.tar.gz"' had status 1
Warning in install.packages :
  installation of package ‘C:/Users/SO310400/AppData/Local/Temp/RtmpeMm13f/downloaded_packages/httr_0.6.0.tar.gz’ had non-zero exit status

Any insighful help will be really appreciated and awarded!

2

There are 2 best solutions below

0
On

I had the same problem.

In the option of permissions of your application you need to change to "Read, Write and Access direct messages"

library("twitteR")
library("bitops")
library("RCurl")

api_key <- your api_key "
api_secret <- "api_secret"
access_token <- "access_token"
access_token_secret <- "access_token_secret"

setup_twitter_oauth(api_key, api_secret, access_token, access_token_secret)

datascients_tweets <- searchTwitter("datascience", n=1000, lang ="en")

Note. Another thing I did was activate the features of the ISS. I do not know if that helped solve the problem and disable the firewall.

0
On

You might need to restart your r-session after installing httr v0.6.1.

I had the same problem. Installing httr v0.6.1 with twitteR 1.1.8, and subsequently restarting my r-session got it working.

Good luck!