Firebase auth: Google sign in pop up window doesn't show up again once after I sign in with an acccount

Viewed 2371

I don't know if this question is related to Firebase or programming but I am doing mobile development and I am testing if google authentication works on emulator on Android Studio. Google authentication works but the problem is sign in pop up window doesn't show up once after I sign in with an account and sign in with an account automatically. So it doesn't show up when I try to sign in with another account after signing in and logging out. Is this normal behavior? How can I always choose an account when signing in?

3 Answers

Google authentication works but the problem is that the sign-in pop up window doesn't show up once after I sign in with an account and sign in with an account automatically. So it doesn't show up when I try to sign in with another account after signing in and logging out. Is this normal behavior? How can I always choose an account when signing in?

Yeah, this is the normal behavior of google auth. Once you sign in with an account, it will automatically use the signed-in account next time as well. If you want to use another account, then you need to clear the app data & cache from the mobile setting. To clear app data & cache, check this one.

I was getting the same problem and this is called a SmartLock which is enabled by default

I am not getting your code but what is did is below

 List<AuthUI.IdpConfig> providers = Arrays.asList(
            new AuthUI.IdpConfig.EmailBuilder().build(),
            new AuthUI.IdpConfig.PhoneBuilder().build(),
            new AuthUI.IdpConfig.GoogleBuilder().build());
    startActivityForResult(AuthUI.getInstance().createSignInIntentBuilder()
            .setAvailableProviders(providers)
            .setIsSmartLockEnabled(false) // just added this line now it asks to sign in at every install 
            .build(), RC_SIGN_IN);

check if you can call this method somewhere

above code gives you a default UI with all the provider which are provided by you

Related