I had the exactly same issues as described in this question, in which I got similar errors. But I've followed instructions, changing the callback url and a new issue came up. I get to the authorization part through my browser but I keep getting stuck in loading page with the the warning "Redirecting you back to the application. This may take a few moments." and instead of being redirected, the browser stops and warns that it can't reach the page - also, RStudio crashes right after it. What should I do? I tried searching for similar questions, but I haven't been able to find a solution.
Although this a bit repetitive, here it is the code in R:
library(twitteR)
Consumer_key <- "key"
Consumer_secret <- "secret"
setup_twitter_oauth(Consumer_key,Consumer_secret, access_token=NULL,access_secret=NULL)
[1] "Using browser based authentication"
Waiting for authentication in browser...
Press Esc/Ctrl + C to abort