Firebaseui-android: Support for multiple accounts-Multiple providers login need it

Created on 31 Jul 2016  路  7Comments  路  Source: firebase/FirebaseUI-Android

The login behaviour it's exclusive. If you login with facebook you can't login with mail and viceversa. Same happens with the other providers.

I'm doing an app in which I need to log in the user even if they don't have facebook but I need to have the option of adding a provider on top of the one which you used for logging in, cause in case the guy logs in with email I need to be able to connect to facebook even after logging in....Maybe I can already do that and it's not documented it, can someone clarify me that?

auth fix-implemented bug

Most helpful comment

It will be really great to have this feature.

Scenario: User has logged in using email/google where the email address is [email protected]. Now at a later stage if the user is logging with facebook and we get the same email [email protected], it should automatically merge the accounts and login successfully.

All 7 comments

This is not currently supported through this library.

You can manually link different credentials by using FirebaseAuth#linkWithCredential. Take a look at the guide here

It will be really great to have this feature.

Scenario: User has logged in using email/google where the email address is [email protected]. Now at a later stage if the user is logging with facebook and we get the same email [email protected], it should automatically merge the accounts and login successfully.

I see there is actually a screen for this feature, but it doesn't seem to handle the case when there are no password-based credentials for the user.

Steps to reproduce the issue:

  1. authenticate with a user using Google login. Don't create e-mail/password based credentials for the user.
  2. authenticate with Facebook, set up so that it provides the same e-mail address as the Google login.
  3. a screen will pop up, saying that there is already a user with the given e-mail address, and I should type his password to merge accounts. But I have no password to type. If I type anything, the app just jumps back to the account chooser activity and logs this stack trace to the console:
09-09 13:35:11.901 9683-9683/my.app.id W/WelcomeBackPassword: Error signing in with email and password
  com.google.firebase.auth.FirebaseAuthInvalidCredentialsException: The password is invalid or the user does not have a password.
      at com.google.android.gms.internal.zzafd.zzes(Unknown Source)
      at com.google.android.gms.internal.zzafa$zzg.zza(Unknown Source)
      at com.google.android.gms.internal.zzafl.zzet(Unknown Source)
      at com.google.android.gms.internal.zzafl$zza.onFailure(Unknown Source)
      at com.google.android.gms.internal.zzafg$zza.onTransact(Unknown Source)
      at android.os.Binder.execTransact(Binder.java:453)

I have the "One account per email address" feature enabled in Firebase Console.

@kustra Looks like a bug. We will investigate.

This is actually currently supported by the library, I followed these steps and was able to link a Google and Facebook account:
1) delete all users
2) log in with Google ([email protected])
3) sign out
4) log in with Facebook ([email protected])
5) I am taken to the "WelcomeBackIdpPrompt" screen which does the linking.

If it is not working it sounds like a bug, I will try to investigate

I tested it with #309 and linking occurs as expected.

I am using firebase SDK in android to implement Social login . I have enabled single email sign in firebase console. My problem here is that User logged in with Facebook is overrides on google sign in and I'm getting FirebaseAuthUserCollisionException when I try login with Facebook again. Can anyone help me how to silently login with existing credentials on FirebaseAuthUserCollisionException. getCurrentUser is null after the exception. I have no clue how to handle this

Was this page helpful?
0 / 5 - 0 ratings