Facebook app redirecting to different subdomains

浪尽此生 提交于 2019-12-21 12:57:37

问题


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://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 ?


回答1:


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)




回答2:


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.



来源:https://stackoverflow.com/questions/7666161/facebook-app-redirecting-to-different-subdomains

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!