I have an app that uses Facebook exclusively as a provider for authentication and have correctly setup the callback for production mode. In order for this to work, you provide your Facebook app with a site URL and a site domain for callbacks, and in my case it’s http://appname.heroku.com and appname.heroku.com respectively.
The problem is that my controllers are setup to only allow authenticated sessions so I cannot view my app in development mode because the Facebook app’s domain obviously hasn’t been set to localhost.
How do I get around this without having to change it in Facebook’s settings?
Create another one facebook app with domain
localhost:3000for development and createconfig.ymlin theconfigdirectoryNow add load_config.rb to the initializers folder
And finally add this to the
omniauth.rbIt will take your keys depending on rails environment. That’s all, hope it helps you.