I had a requirement of adding facebook integration with our Rails app. I am using omniauth-facebook gem for the authentication part and it works great. Our app has multiple subdomains for all clients, so i wanted to callback URLs separate for each client. For example, For foo.example.com, callback