Twitter oAuth callbackUrl - localhost development

后端 未结 17 1419
佛祖请我去吃肉
佛祖请我去吃肉 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:20

    When I develop locally, I always set up a locally hosted dev name that reflects the project I'm working on. I set this up in xampp through xampp\apache\conf\extra\httpd-vhosts.conf and then also in \Windows\System32\drivers\etc\hosts.

    So if I am setting up a local dev site for example.com, I would set it up as example.dev in those two files.

    Short Answer: Once this is set up properly, you can simply treat this url (http://example.dev) as if it were live (rather than local) as you set up your Twitter Application.

    A similar answer was given here: https://dev.twitter.com/discussions/5749

    Direct Quote (emphasis added):

    You can provide any valid URL with a domain name we recognize on the application details page. OAuth 1.0a requires you to send a oauth_callback value on the request token step of the flow and we'll accept a dynamic locahost-based callback on that step.

    This worked like a charm for me. Hope this helps.

提交回复
热议问题