How can I add localhost:3000 to Facebook App for development

蹲街弑〆低调 提交于 2019-11-28 05:49:53

On the Facebook App page, click "edit App" then click "Advanced" in the left-hand navigation. Then for "Valid OAuth redirect URIs" add http://localhost:3000... or whatever you want the accepted redirect to be.

Taylor714

You can create a test app that's connected to your main app. On the Dashboard or Settings page for your main app. scroll down and you'll see "Test Apps" in the menu that runs down the left side of the page. The test app will inherit settings from the main app, but it will permanently be in development mode, and it will have its own ID.

More info on test apps here: https://developers.facebook.com/docs/apps/test-apps/

The protocol for setting up an app to work on localhost has changed. After you get your test app set up, this explains the steps for setting it up to work on localhost:

https://stackoverflow.com/a/24253054/2803458

Your error is saying

localhost URL is not allowed in the application

I know, FB does not give a s**t about explaining, what do to in those moments, however, as far as I am concerned, I have found workaround.

Basically, you need to "whitelist" locahost url in your app

Here is what you are going to do

  1. Go to the app edit/summary page
  2. In the fourth field App Domains, you should already have roomidex.com, so add another address localhost
  3. The urls mentioned above are only valid, if each one of them is put into tabs, where you set, how you app integrates with Facebook (website with facebook login, App on facebook, Mobile web, …)
  4. I do this: I put my working URL, in your case roomidex.com into Website with facebook login, and my test, localhost URL, either into App on facebook or Page tab

June 2015

Go to My Apps > Settings > Basic

App Domains

  • localhost

Site Web

It didn't work with port 80 or without any port unfortunately.

Adding localhost to the Valid OAuth redirect URIs in the test app did not work for me but adding 127.0.0.1 did.

Facebook now requires "Valid OAuth redirect URIs" to be https.

To use https locally (localhost:3000), I used [ngrok][1] which allows you to use https by providing a tunnel. To do this:

  1. I went to their website and downloaded their program
  2. I extracted the file for the program
  3. In my console, I went into the directory where ngrok was extracted to and entered 'grok http 3000' on my Windows machine, others may use './grok http 3000'
  4. After entering that, ngrok provided a https address which I put into the Valid OAuth Redirect URIs field in Facebook
  5. Then I started my server and was able to access it using that https address instead of localhost:3000

Just create two applications.

One for testing and one for release. You cannot supply the app with separate URL configurations.

Just edit your hosts file with your domain that pointing to localhost and it should work fine.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!