Dancer::Plugin::Auth::Twitter gives 401, and how to “fix it.”

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, 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?

This entry was posted in dancer, perl. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s