Twitter oAuth callbackUrl - localhost development

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

    Callback URL edited

    http://localhost:8585/logintwitter.aspx
    

    Convert to

    http://127.0.0.1:8585/logintwitter.aspx
    
    0 讨论(0)
  • 2020-11-27 11:18

    set callbackurl in twitter app : 127.0.0.1:3000 and set WEBrick to bind on 127.0.0.1 instead of 0.0.0.0

    command : rails s -b 127.0.0.1

    0 讨论(0)
  • 2020-11-27 11:20

    Use http://smackaho.st

    What it does is a simple DNS association to 127.0.0.1 which allows you to bypass the filters on localhost or 127.0.0.1 :

    smackaho.st. 28800 IN A 127.0.0.1

    So if you click on the link, it will display you what you have on your local webserver (and if you don't have one, you'll get a 404). You can of course set it to any page/port you want :

    http://smackaho.st:54878/twitter/callback

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-11-27 11:24

    Seems nowadays http://127.0.0.1 also stopped working. A simple solution is to use http://localtest.me instead of http://localhost it is always pointing to 127.0.0.1 And you can even add any arbitrary subdomain to it, and it will still point to 127.0.0.1

    See Website

    0 讨论(0)
提交回复
热议问题