Error: Unauthorized


cred$handshake(cainfo = system.file(“CurlSSL”, “cacert.pem”, package = “RCurl”) )
Error: Unauthorized

I have tried several ways to fix it up , i updated my R to newest version(3.0.1) , i updated all packages for Authentication but still i am not able connect MY R software to twitter server .

I am trying to open the application with my R software and analyse the data into R which is my UNI project. i have tried by Rstudio as well but no result and same error. would you please give me a solution or any tip with this reminder i updated and installed all necessary packages and library into my R . but same result i have got!!
this is my work:
cred <- OAuthFactory$new(consumerKey=“my key”,
consumerSecret="my secret key ",
authURL=“” )
cred$handshake(cainfo = system.file(“CurlSSL”, “cacert.pem”, package = “RCurl”) )
Error: Unauthorized


same error i am facing…any help


Hi irin, eventually I fixed the problem . You need to re-create your application on twitter again ! How? Simply go to your application on twitter and DELETE and then make a new application that’s it and it works. Let me know if you got result.


I have same problem, I could finish authentication successfully
[1] TRUE
but I could not access twitter API by getURL:
cainfo = system.file(“CurlSSL”, “cacert.pem”, package = “RCurl”))

[1] “{“errors”:[{“message”:“Bad Authentication data”,“code”:215}]}”
what am I doing wrong?
@cmq71: I made new application also, but it does not work.


download.file(url=“”, destfile=“cacert.pem”)
requestURL <- ""
accessURL <- ""
authURL <- ""
consumerKey <- "myKey"
consumerSecret <- "mySecret"
Cred <- OAuthFactory$new(consumerKey=consumerKey,

  •                      consumerSecret=consumerSecret,
  •                      requestURL=requestURL,
  •                      accessURL=accessURL, 
  •                      authURL=authURL)

Cred$handshake(cainfo = system.file(“CurlSSL”, “cacert.pem”, package = “RCurl”) )
Error: Unauthorized

Did anyone make it work??? I have already deleted the app and created a new one. I’m on Windows XP Home edition. I use R 3.0.2 and my packages are updated.

I don’t own a domain. I’m using my blog URL in the website field. Could this be the problem?


has there been a solution to this??


the creation of a new app, new api key and secret, worked for me


Error in function (type, msg, asError = TRUE) :
SSL certificate problem, verify that the CA cert is OK. Details:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

in R!!!

how can i fix it up??

I heard that cacert.pem <— is necessary to solve this problem, but even CA is not a ley of this probelem anyone help?




download.file(url=“”, destfile=“cacert.pem”)

reqURL <- ""
accessURL <- ""
authURL <- ""
twitCred <- OAuthFactory$new(consumerKey = consumerKey,
consumerSecret = consumerSecret,
requestURL = reqURL,
accessURL = accessURL,
authURL = authURL)
twitCred$handshake(cainfo = system.file(“CurlSSL”, “cacert.pem”, package = “RCurl”))
Error: Unauthorized

I deleted and created new app, yet I am getting the error: Unauthorized message.
Please help resolve this issue.


you have “mykey” both in the consumerKey and consumerSecret line, you want something like “mysecretkey” in the consumerSecret assignment.


could you give your R code? thanks


have tried all of these but didn’t work. any solution about this “Error: Unauthorized” ???

download.file(url=“”, destfile=“cacert.pem”)

twitCred$handshake(cainfo=“cacert.pem” , ssl.verifypeer = FALSE )
twitCred$handshake(cainfo = system.file(“CurlSSL”, “cacert.pem”, package = “RCurl”))


finally i got the solution, please try this method

install_github(“twitteR”, username=“geoffjentry”)

api_key = "aaa"
api_secret = "bbb"
access_token = "ccc"
access_token_secret = "ddd"


I tried the above but last line error.

Error: could not find function “setup_twitter_oauth”


I’m having same issue. Deleting app doesn’t work. Did anyone solve it?


I also got the same error. How to resolve it?


Same Issue… Please help


Guys… I created a new app and it worked for me…


Guys… I created a new app and it worked for me…