Android FirebaseUi Auth Does Not Prompt Google Account Selection during Sign In

March 31, 2019

If you are using FirebaseUI for Firebase Auth, you might bump into issue where Google signin always automatically signin using the previously selected account, without prompting for account selection after you signout.

NOTE: I didn’t have this issues on Xiaomi Mi4i Android 5 (Lollipop), but it is persistent on Samsung S9 Android 8 (Oreo).

You need to disable SmartLock when creating AuthUI intent.

val providers = arrayListOf(
    AuthUI.IdpConfig.GoogleBuilder().build(),
    // AuthUI.IdpConfig.EmailBuilder().build(),
    AuthUI.IdpConfig.AnonymousBuilder().build()
)

val intent = AuthUI.getInstance()
    .createSignInIntentBuilder()
    .setIsSmartLockEnabled(false)
    // .setIsSmartLockEnabled(false, true)
    .setAvailableProviders(providers)
    .build()
startActivityForResult(intent, REQUEST_SIGN_IN)

When signout, you should use AuthUI.getInstance().signOut rather than FirebaseAuth.getInstance().signOut.

// FirebaseAuth.getInstance().signOut()
AuthUI.getInstance().signOut(context)

References:

This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.