问题
I have an application hosted on Azure and accessed through a web page. Authentication to the application is handled by signing in through Facebook. The application is not a Facebook canvas application, though it can share some activity to a user's Facebook stream.
I have two URLs to access my service; one http://projectgreenwich.cloudapp.net/ points to the site in the cloud (on Azure) while the other http://projectgreenwich.research.microsoft.com relies on DNS to give the application a more official looking URL. My problem is that in the Facebook application set-up (http://developers.facebook.com/apps/) I can only give one "App Domain" for the Facebook authentication to pass back to. I can fork from that domain, e.g. having projectgreenwich.cloudapp.net, projectgreenwichlocal.cloudapp.net, projectgreenwichtest.cloudapp.net, etc. But if I try to add a different domain (e.g. projectgreenwich.research.microsoft.com) I get an error when I save the Facebook app settings.
My solution has been to add http://projectgreenwich.research.microsoft.com as what Facebook term the "Mobile Web URL" for the app. This fixes my immediate problem (authentication on Facebook from http://projectgreenwich.research.microsoft.com works) but it leaves me uncomfortable about two things:
- It's a hack. The http://projectgreenwich.research.microsoft.com URL is no more a "Mobile Web URL" than the http://projectgreenwich.cloudapp.net/ is.
- If I add other DNS entries resolving to http://projectgreenwich.cloudapp.net/ there's no further place to add them.
There are a couple of related answers on Stack Overflow that suggest this is not possible and that Facebook’s blog-post to the contrary is misleadingly worded, but I’m hoping things have changed:
- Zachary Kestenbaum's answer to ginja's question "Is it possible to configure a Facebook app to be used across multiple domains?" here: https://stackoverflow.com/a/7722584/575530
- Ross' answer to Winaji's question "Facebook Connect for one application with multiple domains?" here: https://stackoverflow.com/a/4449914/575530
What’s the correct/best approach to have multiple unrelated App Domains associated to a Facebook application?
来源:https://stackoverflow.com/questions/9786201/what-s-the-correct-best-approach-to-have-multiple-unrelated-app-domains-associat