Im using FirebaseAuthUI (the opensource prebuilt sign-in UI provided by Firebase) to authenticate users. It has a feature that allows you to link multiple Auth Providers under a single firebase account. So someone logging in using their Google ID can also later log in using their Facebook ID (or even just using email and password) and all these separate login methods are meant to be able to be linked under a single firebase account. However, how can I actually link these separate accounts.
The documentation on page states
- Complete the sign-in flow for the new authentication provider up to, but not including, calling one of the FIRAuth.signInWith methods. For example, get the user's Google ID token, Facebook access token, or email and password.
I'm using the prebuilt authUI, I haven't implemented any sign-in flow like mentioned above so how can I do this with the prebuiltUI login flow
Also, if a single user has a facebook account based on one email address and that same user has a google account based on a different email address (quite common as google forces account holders to use a gmail address if one exists), can these 2 accounts still be successfully linked (given they are based on different email addresses) under firebaseAuth?