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

Don P picture Don P · Jan 3, 2014 · Viewed 27.1k times · Source

I am working on a Rails 4 app. On my laptop, development is done at localhost:3000. The actual domain of the site is roomidex.com.

How can I set up a Facebook app so it works on 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 do a Facebook login on localhost:3000, I get this not surprising error:

{
   "error": {
      "message": "Invalid redirect_uri: Given URL is not allowed by the Application configuration.",
      "type": "OAuthException",
      "code": 191
   }
}

Answer

Don P picture Don P · Jan 8, 2014

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.