Each customer in our ror app is served based on subdomain and they have their fbappid, fbsecretid (whichi powers the customers fb app). We use omniauth, omniauth-facebook for authenticating users.
so customer1.ourapp.com serves an fb app with appid fbapp_1 and
customer2.ourapp.com server with appid fbapp_2
normal way of initialization of facebook strategy is putting the following line in a initializer
config.omniauth :facebook, APP_ID, SECRET, {:scope => 'publish_stream}
We need to set APP_ID, SECRET based on the subdomain, but it looks like request object is not avaiable at the initializer time
I looked into the dynamic setting of options using setup=> but omniauth-facebook doesnt seem to support setting of appid, appsecret dynamically.
How do we set the app_id and app_secret of omniauth-facebook dynamically based on subdomain of the request? thanks in advance
Since you are using devise, try
http://webcache.googleusercontent.com/search?q=cache:zmBqDAomJ84J:blog.cedricbousmanne.com/+&cd=2&hl=en&ct=clnk
provides the solution without devise, with just omniauth
[edited]
Excerpt from working code