Twitter oAuth callbackUrl - localhost development

后端 未结 17 1387
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-27 10:21

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:

17条回答
  •  死守一世寂寞
    2020-11-27 11:00

    It can be done very conveniently with Fiddler:

    • Open menu Tools > HOSTS...
    • Insert a line like 127.0.0.1 your-production-domain.com, make sure that "Enable remapping of requests..." is checked. Don't forget to press Save.
    • If access to your real production server is needed, simply exit Fiddler or disable remapping.
    • Starting Fiddler again will turn on remapping (if it is checked).

    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).

提交回复
热议问题