Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Facebook Connect for one application with multiple domains?

I'm implementing a plug-in that's embeddable in different sites (a la Meebo, Wibiya), and I want to use Facebook Connect. The plug-in is supposed to be embeddable in sites with different domain names. Problem is, Facebook connect allows only one domain per application you register.

The question is, how can I have multiple domains for a single Facebook application, assuming:

  1. When users "Allow" the application on one site, they won't have to "Allow" it on other sites as well.

  2. Preferably, after the initial log-in, users won't see a pop-up opening on every site they log-in to (i.e. - I'd rather not open a link to my domain and do the log-in process from there).

Is there anyway of doing that?
If not, is my only option is to manage all the log-ins from a single domain and pass the cookies back to the original domains?
And if I pass the cookies between domains, how can I be sure that Facebook won't block this kind of behavior in the future?

I'd appreciate any suggestions, though I'd prefer an official solution over hacks, if at all possible.

like image 658
Ofirov Avatar asked Dec 13 '10 17:12

Ofirov


People also ask

How do I add another domain to Facebook app?

Before you enter your domain, first click on Add Platform, select website, enter your site URL and mobile site url. Save the settings. Thereafter, you can enter the domain name in the App domains field.

Can you verify multiple domains on Facebook?

Click on the Add button, and enter your domain in the Add a Domain pop-up dialog. If you have more than one domain listed, select the domain for which you desire to confirm ownership. Choose the method you wish to use to verify your domain: DNS Verification, Meta Tags or the HTML File Upload.

Can you add multiple websites on Facebook?

It is easier to add the website address to your Facebook page. This is a relatively simple process. You can even add multiple websites. All you have to do is edit your profile information.

How do I link my Facebook page to my domain?

Click Use My Domain on the domain you want to connect to your Facebook page. Click Connect to an Existing Site. Select the Facebook option under the Social Sites section. Type in your Facebook URL, which you can find in the General Account Settings on your Facebook page.


1 Answers

Im assuming you are using facebook.php by Naitik Shah? Your widget would need to be on every page of course and include the async script connect-js. I am currently developing a facebook login based application myself.

I would say the best solution is too login through your own domain and pass the cookie. Your app/widget will be the only one they allow to share information with. Nothing should be different in operation from a single page solution. I envisage a PHP plugin which executes a login from an outside domain and passes through the cookie to the site via the widget. return the cookie securely how you wish (except for something dodgy like storing it in a div and retrieving it..or something a hacker could try to spoof). the site will then use the cookie for account and user id purposes and the widget will control all login actions and session finding using the async script (but routed through a different domain).

Sorry I can't be more help but this is the only solution I can think of, and it seems you have already anyway.

In terms of keeping session control across different domains you only need the 3rd party cookie to be active. Once your page is activated for your domain you will already have the cookie for that domain if you haven't logged out or it hasn't expired. A benefit of using an outside management domain.

It would seem this is also the most reliable way compared to any successful hack for multiple domains, because I would see fb and Oauth2.0 as being ok with an approved party sharing info (cookies) to another party approved by the approved party. But.. It could be problematic if they think the user will have privacy issues, because you could potentially share the cookie on any site without the users permission. So you have to be careful about notifying the user about all the sites they will be auto logged into and treating them with respect.

Good luck with it, hope you let us know how it goes.

like image 168
Ross Avatar answered Sep 22 '22 03:09

Ross