Facebook app redirecting to different subdomains
We're integrating facebook in our platform; we serve different customers and each one has a different access URL: http://customer1.example.com; http://customer2.example.com and so on. We're implementing OAuth 2.0 so customers are able to perform certain facebook actions from within the app.
From the looks of the documentation (https开发者_Go百科://developers.facebook.com/docs/authentication/), it seems that we'll need one facebook app per customer, to make the authorization flow work. Is there a way to specify a "wildcard" Site URL, let's say: http://*.example.com ?
UPDATE 3/19/2014 - there have been complaints that this functionality has been disabled.
The tooltip text next to the App Domains setting in the facebook settings page explicitly states that this is possible:
Enable auth on domain and subdomain(s) (e.g., "example.com" will enable *.example.com)
No. You need a fixed URL. If you want to segregate the customers, then I would put a callback URL which can redirect the user correctly.
So, you have the callback URL as "http://callback.example.com". The app at callback.example.com, looks up the customer who is logged in and redirects them to the appropriate URL.
精彩评论