Working with Facebook login from localhost

前端 未结 9 2109
无人及你
无人及你 2020-12-09 08:29

I have a React/Horizon app with facebook login. I am wondering if there is any option to work with facebook login from localhost?

相关标签:
9条回答
  • 2020-12-09 09:16

    The method FB.login can no longer be called from http pages.localhost, I get: App domains must match the domain of the Facebook Web Games URL (https), Mobile Site URL, Unity Binary URL, Site URL or Secure Page Tab URL. Please correct at least one of these domains: localhost

    0 讨论(0)
  • 2020-12-09 09:20

    You need to register as facebook developer and create you app there. Once you have your web app registered you can go to your app and click on add product.

    Add Facebook Login. Then enable Web OAuth Login and add your localhost in the textfield below and save, you should be able to access it. Attaching a sample screenshot of my facebook app.

    0 讨论(0)
  • 2020-12-09 09:21

    All these answers are good.

    However I want to add information about how to create a Test app (as recommended by Facebook).

    Go to the page to manage Facebook apps (you, the admin must be logged in): https://developers.facebook.com/apps/

    Hover over the block containing your live Facebook app and click on the down arrow button that appears on the top right corner. Then select Create Test App from the menu.

    The test app will be created with a snapshot of your production app's settings. After this, you can independently edit the settings of your test app without affecting your production app.

    See the documentation here: https://developers.facebook.com/docs/apps/test-apps/

    Regarding the rest of the setup:

    • keep your app in Development mode
    • go to Settings -> Basic (left hand menu) and
      • enter "localhost" for the App Domain
      • change your Site URL to the localhost version (e.g. http://localhost:3000/users/auth/facebook)
    0 讨论(0)
提交回复
热议问题