Twitter oAuth callbackUrl - localhost development

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

    These are the steps that worked for me to get Facebook working with a local application on my laptop:

    • goto apps.twitter.com
    • enter the name, app description and your site URL Note: for localhost:8000, use 127.0.0.1:8000 since the former will not work
    • enter the callback URL matching your callback URL defined in TWITTER_REDIRECT_URI your application Note: eg: http://127.0.0.1/login/twitter/callback (localhost will not work).
    • Important enter both the "privacy policy" and "terms of use" URLs if you wish to request the user's email address
    • check the agree to terms checkbox
    • click [Create Your Twitter Application]
    • switch to the [Keys and Access Tokens] tab at the top
    • copy the "Consumer Key (API Key)" and "Consumer Secret (API Secret)" to TWITTER_KEY and TWITTER_SECRET in your application
    • click the "Permissions" tab and set appropriately to "read only", "read and write" or "read, write and direct message" (use the least intrusive option needed for your application, for just and OAuth login "read only" is sufficient
    • Under "Additional Permissions" check the "request email addresses from users" checkbox if you wish for the user's email address to be returned to the OAuth login data (in most cases check yes)

提交回复
热议问题