Error: Unauthorized


#1

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 ",
requestURL=“https://api.twitter.com/oauth/request_token”,
accessURL=“https://api.twitter.com/oauth/access_token”,
authURL=“https://api.twitter.com/oauth/authorize” )
cred$handshake(cainfo = system.file(“CurlSSL”, “cacert.pem”, package = “RCurl”) )
Error: Unauthorized


#2

same error i am facing…any help


#3

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.


#4

I have same problem, I could finish authentication successfully
#----------
registerTwitterOAuth(twitCred)
[1] TRUE
#-------------
but I could not access twitter API by getURL:
#----------
getURL(“https://api.twitter.com/1.1/statuses/show.json?id=340648555121352705.JSON”,
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.


#5

download.file(url=“http://curl.haxx.se/ca/cacert.pem”, destfile=“cacert.pem”)
requestURL <- "https://api.twitter.com/oauth/request_token"
accessURL <- "https://api.twitter.com/oauth/access_token"
authURL <- "https://api.twitter.com/oauth/authorize"
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?


#6

has there been a solution to this??


#7

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


#8

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?


#9

Worked!


#10

download.file(url=“http://curl.haxx.se/ca/cacert.pem”, destfile=“cacert.pem”)

reqURL <- "https://api.twitter.com/oauth/request_token"
accessURL <- "https://api.twitter.com/oauth/access_token"
authURL <- "https://api.twitter.com/oauth/authorize"
consumerKey<-"mykey"
consumerSecret<-"mykey"
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.


#11

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


#12

could you give your R code? thanks


#13

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

download.file(url=“http://curl.haxx.se/ca/cacert.pem”, destfile=“cacert.pem”)

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


#14

finally i got the solution, please try this method

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

api_key = "aaa"
api_secret = "bbb"
access_token = "ccc"
access_token_secret = "ddd"
setup_twitter_oauth(api_key,api_secret,access_token,access_token_secret)


#15

I tried the above but last line error.

Error: could not find function “setup_twitter_oauth”


#16

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


#17

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


#18

Same Issue… Please help


#19

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


#20

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