I’m working on implementing omniauth into a Rails project. My problem is that the authentication providers – Twitter, Google, Facebook etc all require me to create an application with a url that limits authentication requests from anywhere other than the url. I need to be able to to test locally but also run code in production, but Facebook for example doesn’t allow 2 domains and doesn’t allow localhost anyhow.
So what are my options?
At work, we have multiple applications setup for the different environments. On local, add an entry in
/etc/hosts(assuming you are on linux)eg: 127.0.0.1 mydomain.local.On the facebook app setup for the local environment, add this as the url. Most things, except where facebook needs to scrape your site (Like buttons) work.