Error in check_twitter_oauth() : OAuth authentication error

I am working to establish the connection with twitter using R
Need help to resolve this error:

Error in check_twitter_oauth() : OAuth authentication error:
This most likely means that you have incorrectly called setup_twitter_oauth()'

The code is:

library(twitteR)
library(ROAuth)

customer_key <- "XXXX"
customer_secret <- "XXXX"
access_token <- "XXXX"
access_secret <- "XXXX"

download.file(url="http://curl.haxx.se/ca/cacert.pem", destfile="cacert.pem")
setup_twitter_oauth(consumer_key,consumer_secret,access_token,access_secret)

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

Also I referred to similar answers, but couldnt resolve this error. I have tried the following :
a) used a library(base64enc)
b) Checked the firewall issue, have allowed the R application in Windows defender firewall settings using command prompt - *netsh advfirewall firewall add rule name="app name" dir=in action=allow program="Full path of .exe" enable=yes*
c) Uninstalled R and have installed the latest version.

Kindly let me know how to resolve this error.

Thanks in advance :slight_smile:

This issue has now been resolved.

Code :
library("openssl")
library("httpuv")
library("twitteR")

api_key <- "XXXX"
api_secret <- "XXXX"
access_token <- "XXXX"
access_secret <- "XXXX"

setup_twitter_oauth(api_key,api_secret,access_token,access_secret)

origop <- options("httr_oauth_cache")
options(httr_oauth_cache = TRUE)

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.