0

I have an Android App where user can Login from Google or Facebook.

Considering user can download app in many devices I am facing a situation I need some help or guidance about.

The situations and problems are:

  • When user login in device A with Google and later in Device B => Everything is fine.
  • When user login in device A with Google and later in device B with Facebook firebase auth fail even user is using same email in Google and Facebook.
  • The same if user login first in Facebook and later in Google.

Any idea how to manage that in Firebase Authentication ?

koridallos
  • 115
  • 5

1 Answers1

0

For scenario 2: If you sign up with Google and then try to login with a Facebook account that has the same email as the google account, you will get an error account-exists-with-different-credential:. To handle this situation, check this post: Handling linking accounts in Firebase

For scenario 3: This happens because Google is the issuer of the account (gmail.com). In that case, the Facebook account is unlinked. The next time the user tries to login with the Facebook account they will encounter scenario 2. For more on this, check this post: Authentication using Facebook at first and then Google causes an error in Firebase for Android

bojeil
  • 29,642
  • 4
  • 69
  • 76