I am unable to to sucessfully to do , I followed the following steps as instructed on Firebase Docs:
- Signed in use using existing auth provider(my case:facebook).
- Complete the sign-in flow for the new authentication provider up to, but not including, calling one of the
Auth.signInWith
methods.(my case: i want to link email & password and Google OAUth). So this is the step i'm unclear about, I created a new provider usingvar provider = new firebase.auth.GoogleAuthProvider();
and I did not doFirebase.auth().signInWithPopup(provider)
. - Then to get authcredential for google I run
var credential = firebase.auth.GoogleAuthProvider.credential( googleUser.getAuthResponse().id_token);
(I get an undefined googleUser error) this error seems appropriate since I have not signed in using Google Oauth but thats what the 2nd steps states(not to signin) - And then this command to link with the current user who is on a Facebook Provider
auth.currentUser.link(credential)
My understanding is that currentUser needs to be linked to my existing Provider(Facebook). It seems that credential variable for google is never computed. Anyone with a functional code example would really help.