Search code examples
rubyfacebookfacebook-graph-apiherokukoala

How to correctly set up development version of Facebook app on localhost for Facebook login?


I have made a Facebook app in Ruby (using Sinatra and Koala), deployed it on Heroku and sat up all the settings and it works that way, but now I have to debug some functionality and for that reason I need to run application from localhost (using foreman start). I have read somewhere that I should make development version of my app and specify site url to localhost:[port_num] and I have done so.

  • The problem is when user(me) reach localhost:5000 and application redirects it to Facebook to get permissions (when Facebook login dialog should appears). At that point this error occurs:

    App Not Set Up: The developers of this app have not set it up properly for Facebook Login.

I saw this issue but in my development version of app there is no status and review settings and I don't see how to make application alive.

enter image description here

  • How to set up my app for Facebook Login while it runs on localhost?

or

  • What is the proper way to run Facebook app from localhost to get full functionality?

Solution

  • The problem laid in Advanced settings in security section - development app "inherits" settings from base app so in Settings->Advanced->Security->Valid OAuth redirect URIs was initially url of my base app not my localhost:5000 and it causes a problem. One of solutions is to leave this field empty (and leave app open to redirect attacks) or to fill this field with your Site URL.

    • It seems that development version of an application can't be "alive".
    • To allow Facebook Login for users of your development app you should register them as testers under Roles tab.