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:

  1. where call ? need call every login ?

  2. then need credential every provider each time login ?


Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -