android - Firebase Login multiple provider with same email -
i want user logged in first using fb able log out , log in again using his/her google (same email).
what should do? read https://firebase.google.com/docs/auth/android/account-linking ,but don't quite understand. thought linking link accounts, regardless of email.
while i'm thinking firebase identify user email, if log in , out fb or google using same email, firebase should know same user.
in account-linking docs above, says need credential/tokenid , call linkwithcredential , :
mauth.getcurrentuser().linkwithcredential(credential) .addoncompletelistener(this, new oncompletelistener<authresult>() { @override public void oncomplete(@nonnull task<authresult> task) { log.d(tag, "linkwithcredential:oncomplete:" + task.issuccessful()); // if sign in fails, display message user. if sign in succeeds // auth state listener notified , logic handle // signed in user can handled in listener. if (!task.issuccessful()) { toast.maketext(anonymousauthactivity.this, "authentication failed.", toast.length_short).show(); } // ... } });
my questions are:
where call ? need call every login ?
then need credential every provider each time login ?
Comments
Post a Comment