Each client in our ror application is served based on a subdomain, and they have their fbappid, fbsecretid (which runs the application for fb users). We use omniauth, omniauth-facebook to authenticate users. therefore customer1.ourapp.com serves for fb application with appid fbapp_1 and customer2.ourapp.com server with appid fbapp_2
The usual way to initialize a facebook strategy is to set the next line in the 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 the request object is not available during the initialization time. I looked at the dynamic settings using setup =>, but omniauth-facebook does not seem to support setting appid, appsecret dynamically.
How do we set app_id and app_secret from omniauth-facebook dynamically based on the request subdomain? thanks in advance
source
share