Duplicate authentication problem

650 views
Skip to first unread message

Anton Averin

unread,
Dec 5, 2016, 1:04:20 AM12/5/16
to Firebase Google Group
Hey guys.
Got a double authentication problem.

I'm using Firebase Android.

When app starts I log anonymously with Firebase Auth, and save entry to Firebase Database with to /users/uid, with no data.
Then there is a button to login with Facebook. When user logs in I get his email, and update /users/uid node with `email: a@b.c`

Then user uninstalls the app, and re-installs it.
When he opes the app he is, again, logged in anonymously, with a different uid.
Then he logs in with the same Facebook account.

I assumed that FirebaseUser will have it's uid updated to the old one and I will have new user linked to that old user that was logged in with this Facebook account.
Looks like it's not the way it works, because when I check my Firebase Database I see 2 entries with different id's and same emails.

My question is:
Does Firebase Auth synchronize uid's for different users that log in with same Facebook account?

How can I make sure I don't have 2 id's for the same user?

Thanks

Xiaoqi Hu

unread,
Dec 6, 2016, 5:06:40 PM12/6/16
to Firebase Google Group
Hi Anton,

Could you redo what you described in the "first time"?
You sign in as an anonymous user and get a uid.
Then clicks the button to sign in with Facebook. You receive another token.
Could you check the uid in the second token? Is it different from the anonymous user id?

Thanks,
Xiaoqi
Reply all
Reply to author
Forward
0 new messages