I have a rails application available from 2 domains. Facebook requires me to register a facebook application for each of these domains and give me credentials for each. With Omniauth, I can only specify one set of credentials that is installed when the application starts. However, I will need to provide the FB with different credentials depending on the request host.
There are two problems here:
- How can I change the Omniauth credentials for facebook at runtime?
- How to intercept the facebook call, check the domain and set the credentials accordingly? A before the filter will not work, because Omniauth uses the Rack middleware.
Any suggestions are welcome!
source share