Is anyone else having a difficult time getting Twitters oAuth's callback URL to hit their localhost development environment. Apparently it has been disabled recently. http://code.google.com/p/twitter-api/issues/detail?id=534#c1
Does anyone have a workaround. I don't really want to stop my development
Just put http://127.0.0.1:xxxx/ as the callback url, where xxxx is the port for your framework
Alternative 1.
Set up your .hosts (Windows) or etc/hosts file to point a live domain to your localhost IP. such as:
where xyz.com is your real domain.
Alternative 2.
Also, the article gives the tip to alternatively use a URL shortener service. Shorten your local URL and provide the result as callback.
Alternative 3.
Furthermore, it seems that it works to provide for example
http://127.0.0.1:8080
as callback to Twitter, instead ofhttp://localhost:8080
.I had the same challenge and I was not able to give localhost as a valid callback URL. So I created a simple domain to help us developers out: https://tolocalhost.com
It will redirect any path to your localhost domain and port you need. Hope it can be of use to other developers.
These are the steps that worked for me to get Facebook working with a local application on my laptop:
edit this function on TwitterAPIExchange.php at line #180
It can be done very conveniently with Fiddler:
127.0.0.1 your-production-domain.com
, make sure that "Enable remapping of requests..." is checked. Don't forget to press Save.A pleasant bonus is that you can specify a custom port, like this:
127.0.0.1:3000 your-production-domain.com
(it would be impossible to achieve this via the hosts file). Also, instead of IP you can use any domain name (e.g.,localhost
).This way, it is possible (but not necessary) to register your Twitter app only once (provided that you don't mind using the same keys for local development and production).