-
Notifications
You must be signed in to change notification settings - Fork 198
rtweet_user() 403 errors. #744
Comments
If I recall correctly, user authentication cannot use API credentials but I might be wrong. Have you tried using just Note for myself: The help page does not have a value section so it is not clear in the documentation what is the returned value of the functions documented there. I probably need to document better the rtweet_user system. |
If I use retweet_user(), it'll authorise to the default rtweet twitter app, not so? That is problematic as I won't have control over rate limits. |
Mmh, indeed. All the authentication process is a bit confusing to me but I'll check how to fix this and if there have been some changes in the authentication mechanism. |
The validation error happens on the step 1 of the OAuth dance at the request_token step. The internal error response from Twitter is code 415: "Callback URL not approved for this client application. Approved callback URLs can be adjusted in your application settings." Reference This means that I didn't set up correctly this configuration: I added a required field (type of app) and then I got a Client ID and a Client Secret. If instead of the API key and API key secret I use those I get a 401 error with internal twitter code 32: "Could not authenticate you". If your app worked for authenticating users before it might still work if you use the right client id and client secret. Please let me know if you succeed and which callback urls do you have set up, as I might have hit a rate limit there. As per issue #251 I tried with the callback site I introduced for my app and with the default 127.0.0.1 but I ran into the same problem. I won't be able to try it again in a week or so, but I think that instead of api_key and api_secret they might be better named as client_id and client_secret. Check the slightly improved documentation on the devel branch (version 1.0.2.9010+1) |
Hi @Arf9999, I hope to release a new version of rtweet soon, could you check if it works for your app in the latest version ? Remember using the client ID and client secret instead of the api key and api token? And if you could report back what IP have you set in the configuration page it might help me figure out what might be wrong. Thanks! |
I am not sure if something changed but httr encodes the callback url making it impossible to validate the user (see r-lib/httr#732). It will need to wait until it is fixed upstream (I don't want to ship a modified version of httr just for this). The same happens with oauth 2.0 in httr2 (r-lib/httr2#193) which is what prevents accessing the bookmarked endpoint in #344 |
Ok, so it seems that somehow I messed up with the authentication mechanism at this has gone through the release. It should work again in the devel branch (I also added an option to set your app name for |
Problem
I have two twitter apps, both of which work with rtweet when authenticating using rtweet_app() and rtweet_bot(). However if I try to set up an interactive auth, I get 400 errors.
Expected behavior
When specifying the api_key and api_secret in an rtweet_user() call, I expect an auth token to be returned.
Reproduce the problem
authenticating using rtweet_bot. (keys and secret redacted)
However, when using rtweet_user() with identical api_key and api_secret, which should start the process of interactive authorisation via a browser (unless I'm mistaken):
Please note that exactly the same api_key and api-secret were used. I have replicated this with two separate twitter apps. Am I doing something stupid? Is it a setting that I've missed (I was able to get this type of auth to work on rtweet 0.7, so I don't think it is an issue with the twitter app settings)
rtweet version
Session info
The text was updated successfully, but these errors were encountered: