nativescript-plugin-firebase icon indicating copy to clipboard operation
nativescript-plugin-firebase copied to clipboard

Logging in with same email address (Google, Facebook)

Open mrdeleon opened this issue 8 years ago • 15 comments

It looks like if I create an account with Facebook then create an account with Google using the same email address the Google account will replace the Facebook account.

This doesn't seem to happen the other way around. It will tell me that the email is already associated with a provider.

"Logging in the user failed. com.google.firebase.auth.FirebaseAuthUserCollisionException: An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address."

I feel like replacing the Facebook account with Google credentials is an issue.

mrdeleon avatar Jun 14 '17 23:06 mrdeleon

Hi, @mrdeleon,

Do you have any updates about this topic?

Thanks

smarza avatar Jun 29 '17 13:06 smarza

@smarza no not yet.

mrdeleon avatar Jun 29 '17 14:06 mrdeleon

@mrdeleon I found out something related today.. See if it helps you.

image

smarza avatar Jun 29 '17 16:06 smarza

I took a look at that setting and what I have is the default setting of "Prevent creation of multiple accounts with the same email address". I believe that is what I am looking for.

mrdeleon avatar Jul 18 '17 16:07 mrdeleon

if I active that I can log in properly but I create a new user with a new id. If I need my previous user to see (for example) my post won't work

erperejildo avatar May 31 '18 16:05 erperejildo

How sing in other different ways to firebase user with the same email?

parnekov avatar Sep 18 '18 09:09 parnekov

This is the most updated documentation to log in using @angular/fire/auth, the new library: https://github.com/angular/angularfire2/blob/master/docs/auth/getting-started.md

When I log in twice I get this issue but as I commented above we can't just allow multiple accounts if we want to have always the same user ID

erperejildo avatar Oct 06 '18 11:10 erperejildo

When sign in through facebook with the same emailid used in google sign up, I am showing a error msg to user, I want to specify the EMAIL which has been used, to show in error msg.

mvanan88 avatar Dec 24 '18 09:12 mvanan88

@mvanan88 But potential user from retract from signing in thinking that it is Bug. When ever a user Signs up with Google, we ask him to verify phone number and create database reference based on phone number, then again if the same User logs in with facebook, Then check if phone number is verified, otherwise ask user to verify it. if the phone number is same then, Database reference will be same.

Just an Idea!

vivekshivarajkumar avatar Jan 10 '19 18:01 vivekshivarajkumar

Similar problem: I initially signed in with my github account, then subsequently created a new account (intended as a second, test account) via my gmail account - but that gmail account is the email address associated with my github account. Now I can login via google but not github.

espressofiend avatar Jun 16 '19 22:06 espressofiend

I'm facing this issue also after reinstalling/updating my app. I've found the most acceptable solution here.

IMO having multiple user ID's for the same credentials might be a problem depending on how your application needs to manage users. In my case, allowing multiple accounts for the same email did the job.

felipe-branco avatar Jul 25 '19 01:07 felipe-branco

I have the same issue. If I loggin with email first, Ican login with google OR facebook. But after user login with one of this providers, the component doesnt link the new provider with the exist account. We can disable check unique email account in the firebase, but this broke the logic and the user lost the database.

For avoid errors, now I'm asking email first to check actual providers, then show the options. but this is so weird.

Any suggestion?

ivanthz avatar Jul 22 '20 22:07 ivanthz

Got this answer from (here.) The other option will make you loose the database.

In firebase, it is very important to verify user email account the first time they login with Facebook , by sending a verification email.

Once email is verified, you can login with both Facebook and Gmail if user is using @gmail.com as email address.

f you did not verify the Facebook email before user logout and try to login with their gmail, you will not be able to login with Facebook again the moment they login with their gmail.

igbokwenu avatar Feb 19 '21 14:02 igbokwenu

I have the same issue too. I have logged first with the my Facebook account, and after logged on with my Google account. The account provider in the Firebase has been changed from Facebook to Google.

If we do the reverse process, occurs an authentication error from Firebase. In my case, the best solution is that Firebase throws the same authentication error.

cassioalmeron avatar Jul 30 '21 21:07 cassioalmeron

This is your solution to link any firebase AuthPovider to the same email:

https://firebase.google.com/docs/auth/web/account-linking

This way user will be able to access by email. facebook or google keeping the same ID at firebase.

betocardenas94 avatar Sep 06 '21 00:09 betocardenas94