Android Firebase OAuth sign in strange behavior

122 Views Asked by At

When I first time sign in with Google Account, then log in using Facebook account Firbase return "ERROR_ACCOUNT_EXISTS_WITH_DIFFERENT_CREDENTIAL" It's correct because I disabled sign multi credential options from firebase console.

The problem occurs when I first log in using the Facebook account. The providers is correct, and UserInfo is shows facebook user account info. But email is not verified.

FirebaseUser user = getFirebaseUser();
user.isEmailVerified() // is false

And very strange behavior occurs when I sign in Google account. The fist firebase does not return the same credential exception.Because I have login by facebook account. And Firebase removed facebook account, but i have login in by facebook account. Facbook user info removed from user.getProviderData() I have check Firebase console. There displayed that I logid in by Facebook

1

There are 1 best solutions below

0
On

Check this post to understand why Facebook emails are not verified: Firebase Facebook auth: email verified always false

If you want to consider Facebook emails verified, you can use the Admin SDK admin.auth().updateUser(uid, {emailVerified: true}) to set Facebook emails as verified. Learn more here: https://firebase.google.com/docs/auth/admin/manage-users#update_a_user

Check this post for why the Facebook account gets unlinked after Google sign in: Authentication using Facebook at first and then Google causes an error in Firebase for Android