1

Trying to better understand how firebase works.

Consider this scenario :

App authenticates user through facebook as described here. https://www.firebase.com/docs/android/guide/login/facebook.html

public void onAuthenticated(AuthData authData) { id = authData.getUid()

we want later to be able to connect with the same user with different provider like Twitter for instance.

So user now user authenticates with Twitter and authData.getUid() is the same as in facebook (same across providers guarantee - but not certain that this is how it works :)

question:

if now user uninstalls the app and installs it again and authenticates only with twitter the id = authData.getUid() will be the same? so that we can retrieve the data for the user that we have stored earlier in users/id. Also does that look like a good approach for multiple providers?

AndroidGecko
  • 14,034
  • 3
  • 35
  • 49

1 Answers1

0
  • When a single user authenticates with multiple different providers, they will get a different uid for each

  • When a single user re-installs the app and authenticates (or signs in on a different device) with the same provider, they will get the same uid.

For the de factor answer on how to handle a single user across multiple services, see: How can I login with multiple social services with Firebase?

Community
  • 1
  • 1
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807