-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Multiple accounts with same email not combining (Google & Facebook) #301
Comments
I've perhaps misunderstood firebase's 'multiple accounts per email address' feature. (I assumed it allowed me to join a facebook and google provided user under the same firebase UID, but it looks like it allows multiple different firebase users/UIDs with duplicate emails?) |
@ahaverty I understand your confusion, but this is working as intended. Multiple accounts per email address means exactly what it says: there may be multiple Firebase Auth accounts with the same user email address. These accounts are distinct. In order to get the accounts to merge you need to disable that setting in your console. Then FirebaseUI will attempt the link account flow. |
@ahaverty could you explain your second issue a little more? "not capturing emails after the first user account". I don't quite understand the issue. |
Sure,
Does that make sense? Thanks for clarifying the merge for me, thats exactly what I need |
@ahaverty this does sound like a bug (I didn't implement that behavior but it's not what I would expect either). I will look into it, thanks for the report! |
Just to add a very minor finding. It looks like firebase's console was updated in the last day. Anonymous user's email field is now clearly denoted by '(anonymous)' whereas the issue I was having, still shows the email field as a '-' |
@ahaverty I just spoke with the Firebase team, and they confirmed that this is a known issue with Firebase iteself. |
Any update on when this will be resolve? |
Is this still valid, it was closed as wontfix, but the bug still exists? I am confused... This looks like kinda major issue |
When you check the box in Firebase to not allow duplicate accounts with the same email, I (and most people I imagine) would expect the following functionality: Scenario 1 Scenario 2 Scenario 3 From what I gather, Firebase seems to not give the email/password account much credit. I would expect that the accounts be merged or denied when another account is created associated with the same email. It doesn't except for Gmail. It seems to think Gmail is superior to all other account types and allows it to take precedence. Firebase: Either merge all accounts when logging in with a new provider, or throw an error that an account already exists with that email. The mixed results are annoying and prevent consistent rules. |
@jashick I am surprised at scenario #1, can you file a new issue about that? For #2, it's not that "gmail is superior" but that since this is a Google API talking about Gmail accounts on an Android device in a signed APK we can safely verify gmail ownership. So we know that the user is the same person. |
Maybe I missed something but why is this issue still closed? |
This is the reason why we have moved away from Firebase |
This issue is closed because it's not a problem within FirebaseUI-Android but rather something that exists in the Firebase Android SDK so this is not the right place to track it. |
For me right now, the issue that I am having is if I create an account with Facebook then create one with Gmail using the same email, Gmail overrides the Facebook account, but if I do it vice versa Facebook won't create an account since I look for the error indicating 'auth/account-exists-with-different-credential' in both cases, but only one seems to work. |
I am facing the same problem as you macsinte. It seems Firebase (aka Google) doesn't trust so much in Facebook email registration process or in the Facebook login process... For sure, if someone can fake an email he/she could get access to an unauthorized place - may be this is the line Firebase is going on for now. |
@marcosluizfp you've got the basic idea correct. To add a Facebook credential with an email that matches and existing account you need to use the "link credential" flow to verify the original credential. With Google accounts we can securely verify the email (because Firebase can talk directly to Google's identity systems) so this is not the case. |
@samtstern in this case "link credential" does not work, don't even give any error. You end up with no "currentUser". |
@onurtekin If you're looking for automatic account merging, take a look at #123 (comment) and #123 (comment). |
@SUPERCILEX Actually i don't use Firebase-UI. I have encountered this issue on my IOS app. This is a fresh topic and i couldn't find any IOS topic related to this issue. In my case i try to handle returning users.
I'm afraid this may be a general issue not related to SDK's. Any idea about this? |
Hi I m using firebase auth for my web application. |
@macsinte I'm facing the same problem. When I try to link new Google account with FB or email account already created Firebase overrides those accounts and only new Google account persists. Has anyone overcomed that issue? |
This happens to me also. From email account if the email is not verified, then google overrides this provider. But you can simply add the email verification feature and in case that the user approved his email, google account provider will be added and not overwritten. As for FB, I still don't know why google provider always overrides. |
I'm getting this exact issue when I allow multiple accounts with same email. I only want certain custom domain email accounts to login into my app. But if a user is already registered with email/password and then tries to login with Gmail, I can't get the email information. ALSO: I don't know if this is intended or not, but if a user signs in with Facebook and then tries to recover password, clicking on the password recovery link changes the auth method to email/password and cannot be changed back. |
Any idea how to resolve this. |
samtstern, can you provide the link which this issue is currently going on? Thanks in advance. |
Still seems to be an on-going issue! @davideast any ideas?! |
hi guys, do we have any solutions for this issue ? the issue still occur in 2018. |
We're having the same problem. |
Finally i did some tricky ways to solve the issue. The problem is, FirebaseUser will return null for email, so i got it from callback GoogleSDK and FacebookSDK. Yes, that way not merge the accounts on Firebase Dashboard, but at least i can get the email account after log in from Facebook and Gmail by using the similar account. |
It works for me adding scope 'https://www.googleapis.com/auth/userinfo.email'. |
Another way to retrieve the email is by setting the provider and adding a scope, like this: var provider = new firebase.auth.GoogleAuthProvider(); With this you can retrieve the email from response.additionalUserInfo.profile.email. |
@ahaverty @samtstern @amandle @jashick @maksimluzik We can get email id though we use Gmail and Facebook authentication. I found a way to access email with same email logins for firebase Just use this snippet in on success task from the firebase: Map<String, Object> profile = task.getResult().getAdditionalUserInfo().getProfile(); Thank you. I hope this helps you. Can you give me feedback after you use this code? It helps me. @ahaverty |
Any solution for this issue? |
I'm seeing this now, too. Now sure why this bug is closed. If I log in with Google, then Facebook with the same email address, it fails 100% repeatably with "Developer error" (of all things). The same combination fails on iOS (see firebase/FirebaseUI-iOS#675) and web versions of FirebaseUI too, although on the web if I sign in with both Google AND Apple first, I can oddly sometimes get a Facebook login to work. What the heck is going on here, and why is this ever order dependent? Update: I found firebase/firebase-ios-sdk#5344 (comment) which explains the issue. But I'm still left wondering why there isn't better user-facing error messaging built into Firebase UI when this issue arises. A random "Developer error" isn't useful for the developer or the user - why not just flow into the path that verifies the email and makes it possible to link Facebook to Google? (Or does that work if I implement the email/password flow?) |
The issue described here is a problem with the SDK. Discussing it on the issue tracker for the Firebase UI library will be fruitless. Locking further discussion so you don't waste your time. See also: |
Environment:
The problem:
Signing up with the same email address via two different providers (Facebook and google), is resulting in two different users, but only one having the email address.
Steps to reproduce:
With 'Multiple accounts per email address' enabled, and Facebook and Google signup providers working (and capturing emails) for fresh users.
Expected Results:
I'm expecting the accounts to be joined together.
Am I wrong in assuming FirebaseUI should do this?
Disabling 'Multiple accounts per email address' is a great workaround considering that FirebaseUi notifies a user about an existing account, but it would be nice to get past this small issue if this repo is already capable.
I'm not seeing any logs for firebaseui, presumably because I'm not hitting any errors. Let me know if I should be or if I can provide any more detail.
Thanks for the help!
The text was updated successfully, but these errors were encountered: