-
Notifications
You must be signed in to change notification settings - Fork 199
Authentication failing with auth_setup_default()
#756
Comments
Not sure if this is an issue related to the package or the API itself, as it has been reported to fail in some cases (https://www.theverge.com/2023/1/13/23553161/third-party-twitter-clients-apps-outage-twitterific-tweetbot). |
auth_setup_default()
I have noticed some problems with some endpoints lately, but a couple of days ago I could authenticate without problems. I'll try again and let you know, but I think this is a problem from Twitter not the package. But I have been experiencing some problems with the authentication mechanism, so I will be monitoring/checking them more closely for a while. Thanks for reporting it. |
For anyone with this same problem: Some users have reported that they could authenticate without problems via |
Hi, ive been having this same problem (Bad Request HTTP 400). I just got developer access (essential level) and still have the same problem. I've even ran the rtweet_app() code and entered my bearer token. Are there any additional steps to authenticating the twitter account in R other than running auth_setup_default()? If so, what are the R codes needed? Sorry i am very new to pulling twitter data and R in general as I am a student in an analytics class. Your help would be greatly appreciated! |
@macmac4528 Sorry to hear you have problems with rtweet. However, this is not the place to ask for help as this is to report if there are bugs with the package (which from your comment I don't think there is any). If you have questions, please ask at the rOpenSci forum with exactly the code run in the same order (this is known as reproducible example and there are helpers to get it done such as reprex), it will help me help you. I'm not sure if you have read the authentication vignette but sharing what you tried (as you did here) and what have you read will help too. Good luck! |
Mmh, it seems that while working in #744 I introduced an error that slipped through the checks into the release. Apologies! |
#756 (comment) solved the issue for me! |
Thanks for confirming it @ratnanil. I'll close the issue now (but I'll pin it for users of current release) |
"> Mmh, it seems that while working in #744 I introduced an error that slipped through the checks into the release. Apologies!
Hello, if I do this, it works for one time. Afterward, I have to install the package again, restart Rstudio, and repeat it for the next Account. With the remotes::install it works without restarting, but I still have to repeat the installation. As I want to pull tweets from 1500 accounts, I would like to do it with a for loop, but that is not working for me with installing the package inside the loop. ` for (i in length(df$screen_name)){ tml<- cbind(tml,user) |
Sorry I was to fast, thats my first time. `for (i in 1:length(df$screen_name2)){ remotes::install_github("ropensci/rtweet", force = TRUE) consumer_key <- "xxx" setup_twitter_oauth(consumer_key ,consumer_secret, access_token, access_secret) tml<-get_timeline(df$scree_name[i], n=500, auth_setup_default()) user<-as.character(df$scree_name[i]) tml<- cbind(tml,user) |
@flxmrtn If you want to reuse a token you need to use You seem to use multiple packages. Please post your problem with the package to the original packge causing your issue or post your question in a public site if you have a question about how to use something. |
The Authentication using auth_setup_default() is not working. After I installed the retweet using the development version, there is another error message when I run auth_setup_default(). |
@TCSMA The error message seems to indicate you didn't authorize rtweet to access you account (401 Unauthorized). Maybe you weren't logged in Twitter. Are you sure there is a problem with rtweet? Did you in the browser get redirected to something like |
Thank you very much for your reply. I don't see any window that pops up for authentication. When I first install the rtweet in the development version, there was error about dependency and failed to install it. Then I install rtweet using the published version. Then I install the development version again. Then I got the error message. |
Can you provide the output of |
When I first installed the development version of R, I cannot install it and got the following error message. This step worked on Monday afternoon and stopped working on Tuesday morning.
https://cran.rstudio.com/bin/windows/Rtools/ There is a binary version available but the source version is later: installing the source package ‘rtweet’ trying URL 'https://ropensci.r-universe.dev/src/contrib/rtweet_1.1.0.9011.tar.gz' ERROR: dependencies 'bit64', 'curl', 'httr', 'httr2', 'jsonlite', 'lifecycle', 'progress', 'rlang', 'tibble', 'withr' are not available for package 'rtweet'
Then I installed the published version of rtweet, the installation is successful but cannot use auth_setup_default(). The error message is Then I installed the development version of rtweet again. When I run auth_setup_default(), the error message is
There is no output if I use auth_sitrep() |
When you tried to install from r-universe it told you that the binaries are outdated. When trying to install from source you can't because you don't have Rtools installed. To install RTools you'll need to know the R version and install it from its website. The problem with the binaries is that r-universe only provides them for R 4.3 and R 4.2 not R 4.1 which seem to be the version you are running. It seems that you don't have loaded rtweet and so auth_sitrep didn't work. Try again with So far I haven't seen any evidence that rtweet is failing with rtweet version 1.1.0.9001 or 1.1.0.9011. Please let me know when you have some problems with version 1.1.0.9011 or later. Thanks! |
Thanks a lot! I installed the RTools and reinstall rtweet development version. I successfully installed the version but I still get the same error. It seems that rtweet_user() function returns this error. Error in httr::init_oauth1.0(endpoint, app, permission = permission, is_interactive = is_interactive, : |
@TCSMA Please provide the rtweet version you are using and the output of |
Thank you very much for helping.
|
Sorry, this can be the new Twitter policy regarding the API or something else (that you need elevated access or something). You will have to debug this issue further for me to see if I need to fix something. |
I am also having the same problem. I started to get Tokens from rtweet version < 1.0.0 found on /Users/: and now every time I try auth_setup_default() it is giving me 401 unauthorization error not the 400. I tried to run it on another pc which I didn't try any tokens etc it also does not work. I am doing this on mac R 4.1 and for PC R 4.2 . |
@azadesel You have duplicated tokens but don't seem to have saved bearer tokens (from your academic access) or the default token. You also seem to be using rtweet 1.1.0 with the bug that started this issue. Please install the devel version from github where this is fixed. |
Yes, I uploaded to the latest one (with remotes::install_github("ropensci/rtweet")), still getting the same error. "If you set up your academic access via the bearer token you don't need to run auth_setup_default()." also yes but even though when I enter my bearer and got "Twitter bearer token" on the console when i try to search tweets it is giving me this error. "Error in |
Ok, @azadesel it seem you introduce your token but you don't save or use it for each function. library("rtweet")
token <- rtwet_app()
auth_as(token)
auth_save(token, "academic_token")
su <- search_users("#rstats", n = 200) In a fresh session then you can do this: library("rtweet")
auth_as(token, "academic_token")
su <- search_users("#rstats", n = 200) |
@llrs . Thank you very much for your help. I also saw the developer portal interface changed as well. |
Twitter banned the default app used, reported by the original maintainer:
I won't provide new default authentications (beyond what is in rtweet 1.2). |
Problem
I just installed rtweet v 1.1.0 in a new machine and I cannot authenticate. When I run
auth_setup_default()
I get the following error:Expected behavior
Rtweet should authenticate using my twitter credentials from my logged account in default web browser.
Reproduce the problem
install.packages("rtweet", repos = 'https://ropensci.r-universe.dev')
)rtweet::auth_setup_default()
rtweet version
‘1.1.0.9000’
Session info
The text was updated successfully, but these errors were encountered: