'Facebook Connect with multiple FB accounts

I am developing a business site with Facebook Connect enabled and its working fine for me. Now, I came across a situation where I have a user with 2 or more FB accounts and 1 of them is registered with our site.

For example

[email protected] (Registered on Facebook and using FB connect on our site)
[email protected] (Registered on Facebook but not in our site)

With above email addresses, when a user logs in with [email protected] on Facebook he gets logged in, in our site as well. But on the other side when a user logs in on Facebook with [email protected] and same time logs in on our system with [email protected] (without using FB connect).

Here I see a session conflict and trying to solve it. I hope you people will share your thoughts to help me out.

Regards



Solution 1:[1]

At my site ours users could use

  1. our site's account
  2. a FB account
  3. a FB account merged with our site's account (based on email).

so if someone owns more than one FB account, only the one with matching email would be merged. If someone tries to log with a FB account and that account's email is not registered within our application, a new account in our site is created.

Solution 2:[2]

I have two entities in my System (similar to the way StackOverflow is doing it)..

  • Login (Facebook, Live Id, local User DB - contains NO username / pwd, but just the association)
  • Account / User: The "identity" of the user in MY site (additional data which isn't on Facebook)

N Logins <--> 1 User is the cardinality of these two.

So.. YES you can merge multiple Facebook logins with ONE "local" site user.

If FB-User [email protected] logs in on FB, you can still merge it as well with the local user [email protected].

So at the end you will TWO FB users mapped to the same local user..

Is that the solution you're looking for?

If not, please clarify further.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Sergi
Solution 2 Max