In firebase login getting error “An account alread

2020-07-09 03:04发布

问题:

Here am trying to implement Google, Facebook and Twitter login using firebase.

I have faced many scenario which was not clear for me.

Each individual login is working correctly, I didn`t found any problem here.

My requirement is when the user log-in with xxxxx@gmail.com for the first time with some provider(Google,Facebook,twitter) and after success, user logged out. On second log-in the user use same id xxxxx@gmail.com with some other provide rather than one used before,that time We should not allow the login process. User need to log-in with the same provider from next time.

Below are the cases I found ,

  1. For first time when in log-in using xxxxx@gmail.com using google, after success popup i logged out. For second time i try to log-in using same id xxxxx@gmail.com using Facebook or twitter its throws an error "An account already exists with the same email address but different sign-in credentials".

  2. For first time when in log-in using xxxxx@gmail.com using twitter or Facebook, after success popup I logged out. For second time I try to log-in using same id xxxxx@gmail.com using google. It does not showing any Exception. Here I need to notify the user "xxxxx@gmail.com is associated with twitter or Facebook, Use same provider to login "

I don`t know whats happening in second case.

For this id xxxxx@gmail I have google, Facebook and twitter account.

回答1:

See if it helps you. Change this settings in Firebase console