Search code examples
rtwitteroauthproxyhttr

httr::oauth1.0_token error with twitter api


I'm currently trying to interact with Twitter's Streaming API via the httr package:

library(httr)
my_app <- oauth_app('twitter', consumerKey, consumerSecret)
twitter_token <- oauth1.0_token(oauth_endpoints('twitter'), my_app)

This brings up the following question and error:

Use a local file to cache OAuth access credentials between R sessions?
1: Yes
2: No
Selection: 2
Error in init_oauth1.0(endpoint, app, permission = params$permission) : 
  client error: (401) Unauthorized

How can I fix the problem?


Solution

  • If you ever have problems with twitter OAuth, first check that the callback url is http://localhost:1410