If you are having an issue with Dancer::Plugin::Auth:Twitter where it gives you a 401 and you can’t figure it out, the answer is frustratingly simple.
At some point in the past, Twitter changed their web UI so that there isn’t an explicit “this is a web app” switch, like there used to be. This has to be turned on, in order to not get a 401. Well, how do you turn it on when you don’t have a switch or knob to do so? First go to http://dev.twitter.com, pick your application, and click on the settings tab:
Then, scroll down to “Application Type.” You’d think there’d be something about “web application?” Well, no. You have to explicitly give it a callback URL. Now mind you, this callback URL can be overridden easily with individual OAuth requests, but the fact that you *have* a callback URL makes the twitter dev site know that your application is a web application and it should stop randomly giving you 401s.
There, isn’t that nice and easy?