I had a problem, where my site couldn't authorize with Twitter. Because of the lack of error messages in this part of the site, I couldn't what the problem was. So I added logging of error messages. The url of my website wasn't registered as a callback for Twitter. I added the url in the Twitter developer dashboard for my app and now the Twitter integration works again.