Skip to content
This repository has been archived by the owner on Apr 4, 2023. It is now read-only.

Logging in with same email address (Google, Facebook) #389

Open
mrdeleon opened this issue Jun 14, 2017 · 15 comments
Open

Logging in with same email address (Google, Facebook) #389

mrdeleon opened this issue Jun 14, 2017 · 15 comments

Comments

@mrdeleon
Copy link

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.

@smarza
Copy link

smarza commented Jun 29, 2017

Hi, @mrdeleon,

Do you have any updates about this topic?

Thanks

@mrdeleon
Copy link
Author

@smarza no not yet.

@smarza
Copy link

smarza commented Jun 29, 2017

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

image

@mrdeleon
Copy link
Author

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.

witi83 added a commit to witi83/nativescript-plugin-firebase that referenced this issue Aug 3, 2017
Should fix EddyVerbruggen#357 and EddyVerbruggen#389 and maybe others as well.

This will avoid the exception `com.google.firebase.auth.FirebaseAuthUserCollisionException: This credential is already associated with a different user account`.

This problem occurs if the current user is anonymous, but the `loginResult` points to another already known firebase user (e.g a facebook account). In this case we have to call `firebaseAuth.signInWithCredential(authCredential).addOnCompleteListener(onCompleteListener)` instead of `user.linkWithCredential(authCredential).addOnCompleteListener(onCompleteListener)`
@erperejildo
Copy link

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

@parnekov
Copy link

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

@erperejildo
Copy link

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

@mvanan88
Copy link

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.

@vivekshivarajkumar
Copy link

@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!

@espressofiend
Copy link

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.

@felipe-branco
Copy link

felipe-branco commented Jul 25, 2019

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.

@ivanthz
Copy link

ivanthz commented Jul 22, 2020

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?

@igbokwenu
Copy link

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.

@cassioalmeron
Copy link

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.

@betocardenas94
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests