How to add localhost: 3000 to Facebook for development

I am working on a Rails 4 application. On my laptop, development runs in localhost:3000 . The actual domain domain is roomidex.com .

How can I customize the Facebook app to work in production and development?

Here is the current configuration:

 App Domains: roomidex.com Website With Facebook Login: Site URL: http://www.roomidex.com 

When I try to log in to Facebook on localhost: 3000, I get this unsurprising error:

 { "error": { "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.", "type": "OAuthException", "code": 191 } } 
+28
ruby-on-rails facebook ruby-on-rails-4 omniauth
Jan 03 '14 at 18:42
source share
7 answers

On the Facebook Application page, click Change Application, then click Advanced on the left side of the screen. Then for "Valid OAuth Redirect URIs, add http://localhost:3000 ... or whatever you want the accepted redirect to be.

+59
Jan 08
source share

You can create a test application connected to the main application. On the Dashboard or Settings page for the main application. scroll down and you will see the โ€œTest Applicationโ€ in the menu that runs on the left side of the page. The test application inherits settings from the main application, but it will be constantly in development mode, and it will have its own identifier.

Read more about test applications here: https://developers.facebook.com/docs/apps/test-apps/

The protocol for configuring the application to work on localhost has been changed. After you configure the test application, this explains the steps to configure it to work on localhost:

https://stackoverflow.com/questions/69295/ ...

+6
Jun 16 '14 at 22:49
source share

Your mistake says

In-app local URL not allowed

I know that FB does not explain what to do in those moments, however, as far as I know, I found a workaround.

Basically, you need to whitelist the locahost url in your application

Here is what you are going to do.

  • Go to the edit / resume page of the application.
  • In the fourth field, Application Domains , you should already have roomidex.com , so add another localhost address
  • The above URLs are only valid if each of them is placed in the tabs where you set how you app integrates with Facebook (website with facebook subscription, facebook application, mobile network, ...)
  • I do this: I put my working URL in your case roomidex.com in Website with facebook login , and my test URL is localhost either in App on facebook or Page tab
+4
Jan 03 '14 at 19:20
source share

June 2015

Go to My Applications> Settings> General

Application domains

  • local

Web site

It did not work with port 80 or without any port, unfortunately.

+1
Jun 09 '15 at 17:27
source share

Adding localhost to Valid OAuth redirect URIs in the test application does not work for me, but adding 127.0.0.1 done.

0
Apr 04 '16 at 17:06 on
source share

Just create two applications.

One for testing and one for release. You cannot provide an application with separate URL configurations.

-one
Jan 03 '14 at 19:08
source share

Just edit the hosts file with your domain, which points to localhost, and it should work fine.

-four
May 28 '15 at 10:54
source share



All Articles