-
Notifications
You must be signed in to change notification settings - Fork 198
Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Forbidden (HTTP 403). #251
Comments
I am getting the same error after unticking "Enable Callback Locking." My code is as follows: library(rtweet) create_token(app = "TweeterCatcher", UsersLocal <- search_tweets("#localization", n = 2000, token2 <- setup_twitter_oauth(consumer_key = "x",consumer_secret = "y", access_token="z", |
I am also getting the same error. First, it was just unticking "Enable Callback Locking." I am working with the same code lines. Out of blue i received "Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Forbidden (HTTP 403)". To be precise, since 00:01 Tuesday night (morning of the 13th). After trying a lot and too much i guess i now also receive additional error, " "Error: 32 - Could not authenticate you". |
make sure you have the most recent github version devtools::install_github("mkearney/rtweet") @StupidLaptop You don't need to save the token and token/path. Otherwise these issues should be resolved by providing the correct keys and making sure app configuration is correct. You might also try generating new keys and then retry creating a new token using those. |
@mkearney I tried your suggestions, but they had no effect. I get the same HTTP error 403. I made sure that all the settings in my twitter app are as they are supposed to be per your instructions (I have attached a screenshot for reference). Could it be that the Twitter API now requires the access token and secret? I find strange that twitteR setup_twitter_oauth() works perfectly fine when I add them in addition to the consumer secret and key while create_token(), which worked perfectly until today fails. |
Hrmm, well they haven't changed your ability to create a token that way. What version of rtweet? ## copy/paste output
packageVersion("rtweet") What about R version/ other session info? ## copy/paste output
sessionInfo() And your keys look more like the example below than the word "Token" right? (just making sure) Does the error always happen when you run token <- create_token(app = "TweeterCatcher",
consumer_key = "XYznzPFOFZR2a39FwWKN1Jp41",
consumer_secret = "CtkGEWmSevZqJuKl6HHrBxbCybxI1xGLqrD5ynPd9jG0SoHZbD")
search_tweets("lang:en", token = token) |
Still have also the same problems. Trying all the settings of your instructions, too. Refreshing tokens, installing newest rtweet version, creating a new app, and also the last code. But it always produces an error and cannot run packageVersion("rtweet") R version 3.5.0 (2018-04-23) |
Got the same here : #remotes::install_github("mkearney/rtweet")
packageVersion("rtweet")
#> [1] '0.6.5'
rtweet::create_token(
app = "DataColinFAYR",
consumer_key = "***",
consumer_secret = "***")
#> Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Forbidden (HTTP 403). devtools::session_info()
#> Session info -------------------------------------------------------------
#> setting value
#> version R version 3.4.4 (2018-03-15)
#> system x86_64, darwin15.6.0
#> ui X11
#> language (EN)
#> collate fr_FR.UTF-8
#> tz Europe/Paris
#> date 2018-06-14
#> Packages -----------------------------------------------------------------
#> package * version date source
#> backports 1.1.2 2017-12-13 CRAN (R 3.4.3)
#> base * 3.4.4 2018-03-15 local
#> compiler 3.4.4 2018-03-15 local
#> curl 3.2 2018-03-28 CRAN (R 3.4.4)
#> datasets * 3.4.4 2018-03-15 local
#> devtools 1.13.5 2018-02-18 CRAN (R 3.4.3)
#> digest 0.6.15 2018-01-28 CRAN (R 3.4.3)
#> evaluate 0.10.1 2017-06-24 CRAN (R 3.4.1)
#> graphics * 3.4.4 2018-03-15 local
#> grDevices * 3.4.4 2018-03-15 local
#> hms 0.4.2 2018-03-10 CRAN (R 3.4.4)
#> htmltools 0.3.6 2017-04-28 CRAN (R 3.4.0)
#> httr 1.3.1 2017-08-20 CRAN (R 3.4.1)
#> jsonlite 1.5 2017-06-01 CRAN (R 3.4.0)
#> knitr 1.20 2018-02-20 CRAN (R 3.4.3)
#> magrittr 1.5 2014-11-22 CRAN (R 3.4.0)
#> memoise 1.1.0 2017-04-21 CRAN (R 3.4.0)
#> methods * 3.4.4 2018-03-15 local
#> openssl 1.0.1 2018-03-03 CRAN (R 3.4.3)
#> pkgconfig 2.0.1 2017-03-21 CRAN (R 3.4.0)
#> R6 2.2.2.9000 2018-06-06 Github (r-lib/R6@a9eb0f1)
#> Rcpp 0.12.17 2018-05-18 CRAN (R 3.4.4)
#> rlang 0.2.1 2018-05-30 CRAN (R 3.4.4)
#> rmarkdown 1.10 2018-06-11 CRAN (R 3.4.4)
#> rprojroot 1.3-2 2018-01-03 CRAN (R 3.4.3)
#> rtweet 0.6.5 2018-06-14 Github (mkearney/rtweet@8b9ba15)
#> stats * 3.4.4 2018-03-15 local
#> stringi 1.2.2 2018-05-02 CRAN (R 3.4.4)
#> stringr 1.3.1 2018-05-10 CRAN (R 3.4.4)
#> tools 3.4.4 2018-03-15 local
#> utils * 3.4.4 2018-03-15 local
#> withr 2.1.2 2018-06-01 Github (jimhester/withr@70d6321)
#> yaml 2.1.19 2018-05-01 CRAN (R 3.4.4) |
Here is with the token you provided just before : packageVersion("rtweet")
#> [1] '0.6.5'
library(rtweet)
token <- create_token(app = "TweeterCatcher",
consumer_key = "XYznzPFOFZR2a39FwWKN1Jp41",
consumer_secret = "CtkGEWmSevZqJuKl6HHrBxbCybxI1xGLqrD5ynPd9jG0SoHZbD")
#> Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Unauthorized (HTTP 401). devtools::session_info()
#> Session info -------------------------------------------------------------
#> setting value
#> version R version 3.4.4 (2018-03-15)
#> system x86_64, darwin15.6.0
#> ui X11
#> language (EN)
#> collate fr_FR.UTF-8
#> tz Europe/Paris
#> date 2018-06-14
#> Packages -----------------------------------------------------------------
#> package * version date source
#> backports 1.1.2 2017-12-13 CRAN (R 3.4.3)
#> base * 3.4.4 2018-03-15 local
#> compiler 3.4.4 2018-03-15 local
#> curl 3.2 2018-03-28 CRAN (R 3.4.4)
#> datasets * 3.4.4 2018-03-15 local
#> devtools 1.13.5 2018-02-18 CRAN (R 3.4.3)
#> digest 0.6.15 2018-01-28 CRAN (R 3.4.3)
#> evaluate 0.10.1 2017-06-24 CRAN (R 3.4.1)
#> graphics * 3.4.4 2018-03-15 local
#> grDevices * 3.4.4 2018-03-15 local
#> hms 0.4.2 2018-03-10 CRAN (R 3.4.4)
#> htmltools 0.3.6 2017-04-28 CRAN (R 3.4.0)
#> httr 1.3.1 2017-08-20 CRAN (R 3.4.1)
#> jsonlite 1.5 2017-06-01 CRAN (R 3.4.0)
#> knitr 1.20 2018-02-20 CRAN (R 3.4.3)
#> magrittr 1.5 2014-11-22 CRAN (R 3.4.0)
#> memoise 1.1.0 2017-04-21 CRAN (R 3.4.0)
#> methods * 3.4.4 2018-03-15 local
#> openssl 1.0.1 2018-03-03 CRAN (R 3.4.3)
#> pkgconfig 2.0.1 2017-03-21 CRAN (R 3.4.0)
#> R6 2.2.2.9000 2018-06-06 Github (r-lib/R6@a9eb0f1)
#> Rcpp 0.12.17 2018-05-18 CRAN (R 3.4.4)
#> rlang 0.2.1 2018-05-30 CRAN (R 3.4.4)
#> rmarkdown 1.10 2018-06-11 CRAN (R 3.4.4)
#> rprojroot 1.3-2 2018-01-03 CRAN (R 3.4.3)
#> rtweet * 0.6.5 2018-06-14 Github (mkearney/rtweet@8b9ba15)
#> stats * 3.4.4 2018-03-15 local
#> stringi 1.2.2 2018-05-02 CRAN (R 3.4.4)
#> stringr 1.3.1 2018-05-10 CRAN (R 3.4.4)
#> tools 3.4.4 2018-03-15 local
#> utils * 3.4.4 2018-03-15 local
#> withr 2.1.2 2018-06-01 Github (jimhester/withr@70d6321)
#> yaml 2.1.19 2018-05-01 CRAN (R 3.4.4) |
@hupseb this is not an rtweet issue, but an httr issue : library(httr)
token <- oauth_app(appname = "TweeterCatcher", key = gsub(" ", "", "XYznzPFOFZR2a39FwWKN1Jp41"),
secret = gsub(" ", "", "CtkGEWmSevZqJuKl6HHrBxbCybxI1xGLqrD5ynPd9jG0SoHZbD"))
connected <- oauth1.0_token(oauth_endpoints("twitter"), token,
cache = FALSE)
#> Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Unauthorized (HTTP 401).
Token1.0$new(
app = token,
endpoint = oauth_endpoints("twitter"),
cache = FALSE
)
#> Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Unauthorized (HTTP 401). Session infodevtools::session_info()
#> Session info -------------------------------------------------------------
#> setting value
#> version R version 3.4.4 (2018-03-15)
#> system x86_64, darwin15.6.0
#> ui X11
#> language (EN)
#> collate fr_FR.UTF-8
#> tz Europe/Paris
#> date 2018-06-14
#> Packages -----------------------------------------------------------------
#> package * version date source
#> backports 1.1.2 2017-12-13 CRAN (R 3.4.3)
#> base * 3.4.4 2018-03-15 local
#> compiler 3.4.4 2018-03-15 local
#> curl 3.2 2018-03-28 CRAN (R 3.4.4)
#> datasets * 3.4.4 2018-03-15 local
#> devtools 1.13.5 2018-02-18 CRAN (R 3.4.3)
#> digest 0.6.15 2018-01-28 CRAN (R 3.4.3)
#> evaluate 0.10.1 2017-06-24 CRAN (R 3.4.1)
#> graphics * 3.4.4 2018-03-15 local
#> grDevices * 3.4.4 2018-03-15 local
#> htmltools 0.3.6 2017-04-28 CRAN (R 3.4.0)
#> httr * 1.3.1 2017-08-20 CRAN (R 3.4.1)
#> knitr 1.20 2018-02-20 CRAN (R 3.4.3)
#> magrittr 1.5 2014-11-22 CRAN (R 3.4.0)
#> memoise 1.1.0 2017-04-21 CRAN (R 3.4.0)
#> methods * 3.4.4 2018-03-15 local
#> openssl 1.0.1 2018-03-03 CRAN (R 3.4.3)
#> R6 2.2.2.9000 2018-06-06 Github (r-lib/R6@a9eb0f1)
#> Rcpp 0.12.17 2018-05-18 CRAN (R 3.4.4)
#> rmarkdown 1.10 2018-06-11 CRAN (R 3.4.4)
#> rprojroot 1.3-2 2018-01-03 CRAN (R 3.4.3)
#> stats * 3.4.4 2018-03-15 local
#> stringi 1.2.2 2018-05-02 CRAN (R 3.4.4)
#> stringr 1.3.1 2018-05-10 CRAN (R 3.4.4)
#> tools 3.4.4 2018-03-15 local
#> utils * 3.4.4 2018-03-15 local
#> withr 2.1.2 2018-06-01 Github (jimhester/withr@70d6321)
#> yaml 2.1.19 2018-05-01 CRAN (R 3.4.4) |
This is the reason: https://twitter.com/TwitterAPI/status/1006635008692350977 As announced last month, today marks the beginning of callback URL whitelisting enforcement. Apps using Sign in with Twitter who have not whitelisted their URLs will experience disruption. To whitelist your URLs, follow the guidance in our May forum post. |
So to summarize the solution: The callback_url is already provided. What worked for me was providing access_token and access_secret. create_token(app=...,consumer_key=..., consumer_secret=..., access_token=..., access_secret=...) |
That worked for me, after installing the latest github version as suggested by @mkearney . Thanks to everyone! |
Same for me. Newest version of r, rstudio as well as rtweet. Now all works fine again. Thank you for fast solution @hupseb. |
Thanks @hupseb for the link! I suppose I should switch documentation over to the full signature method (provide all four keys to create a token), but I'm still puzzled and annoyed that the browser handshake is not working. Twitter claims the |
Anyway, I'm really sorry for the hassle, everyone! I've spent the last month inundated with messages about token creation errors due to these changes by Twitter, and I haven't been able to replicate the errors myself due to being wary of getting disciplined again from Twitter for having multiple tokens* and maybe due to my account being opaquely grandfathering in or something. (*Having to share my personal token with the test token in rtweet makes troubleshooting oauth issues especially annoying for me). Thank you all for being patient and reporting your errors! |
@StupidLaptop @Frank5547 @omhs @hupseb @ColinFay Good news! I believe I've fixed this problem: mkearney@eb9b400 Please let me know if you try it and it works [or doesn't]! |
With the latest dev version, the browser opens and it says I am authenticated, but I get this error in R immediately following the "authentication complete" message: Error in verifier$oauth_verifier %||% verifier[[1]] : Thanks for your hard work on this! <3 |
i just fixed that :) |
! Okay, and now: "Error: Not a valid access token." You are the best! |
Had to dig in a little more to export everything I needed out of the httr pkg but I think it should be good to go now! |
For me it is working nice again. Without any extra token anymore plus now finally registration of the App. Cause exactly what you mentioned, the buttons should be away if you take Twitter by word, but they aren't. Read several times it will be gone after 12th. But anyway. Thank You a lot @mkearney for taking care so fast. That saves my phd work :D |
I'm having the same issue - it looks like the devtools version of the package won't install because I get the following error: ERROR: dependency 'openssl' is not available for package 'rtweet'
Any thoughts? |
Give it another try now. I just moved the openssl dep to 'suggests' instead of 'imports.' |
Thanks. re-installing rtweets from github fixed the error |
On the https://github.com/mkearney/rtweet#api-authorization page, the create_token() function no longer seems to accept the 2b arguments |
I don't see the callback lock button in twitter, and I'm getting the error:
|
Installing form here: devtools::install_github("mkearney/rtweet") and setting the callback url to http://127.0.0.1:1410 finally worked for me. |
https://github.com/mkearney/rtweet/issues/265#issuecomment-464338166 There was a change by Twitter on June 12th. To fix this problem you need to use 4 keys/secrets/tokens. create_token( |
I had the same issue: "Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Forbidden (HTTP 403)" |
I have the same issue. For some reason `token <- create_token( rstats_tweets <- search_tweets(q = "#rstats", n = 500) Use the latest |
Problem
Hi there,
Have been trying to create a token, at first had the 401 issue for not having set up the callback URL. Now after setting it I'm getting this error.
Error in init_oauth1.0(self$endpoint, self$app, permission = self$params$permission, : Forbidden (HTTP 403).
In another thread I saw that apparently unticking the "Enable Callback Locking" should get rid of the error but that hasn't worked either. Just wondering if this is a new bug or if I'm doing something wrong.
This is my code:
`library(rtweet)
appname <- "rTweetFetcha"
key <- "%KEY%"
secret <- "%SECRET%"
twitter_token <- create_token(app = appname, consumer_key = key, consumer_secret = secret)
project_directory <- path.expand(getwd())
file_name <- file.path(project_directory, "twitter_token.rds")
twitter_token
saveRDS(twitter_token, file = file_name)
cat(paste0("TWITTER_PAT=", file_name),
file = file.path(project_directory, ".Renviron"),
append = TRUE)`
The text was updated successfully, but these errors were encountered: