title: How can I disable smart lock for passwords auto login request after Firebase Auth UI sign out?
body: <p>I'm building a single activity Android app in an attempt to follow Google's recommendations. I'm using FirebaseAuth UI for authentication which apparently uses 'Smart Lock for Passwords' to save the credentials into your google account. My sign out function looks like this:</p>
  
  <pre><code>private fun signOutUser(){
      AuthUI.getInstance()
              .signOut(this)
              .addOnCompleteListener {
                  Timber.i("Sign out completed")
              }
      sharedViewModel.setUser(null)
  }
  </code></pre>
  
  <p>However, once the sign out finishes, the UI immediately starts the user sign-in process, which with Smart Lock for Passwords means that a dialog pops up.  This stops users from being able to pick another account. In the github account for FirebaseAuth UI, Google mentions this issue saying:</p>
  
  <blockquote>
    <p>"Smart Lock for Passwords must be instructed to disable automatic sign-in, in order to prevent an automatic sign-in loop that prevents the user from switching accounts."</p>
  </blockquote>
  
  <p>Their suggested code is:</p>
  
  <pre><code>public void onClick(View v) {
    if (v.getId() == R.id.sign_out) {
      AuthUI.getInstance()
          .signOut(this)
          .addOnCompleteListener(new OnCompleteListener&lt;Void&gt;() {
              public void onComplete(@NonNull Task&lt;Void&gt; task) {
                  // user is now signed out
                  startActivity(new Intent(MyActivity.this, SignInActivity.class));
                  finish();
              }
          });
      }
  }
  </code></pre>
  
  <p>But since I have only one activity I cannot do a startActivity.  </p>
  
  <p>So my question is how can I prevent Smart Lock for Passwords from attempting to re-login after a user signs out?</p>
  
  <p>Here is the rest of my auth code if it's relevant:</p>
  
  <pre><code>override fun onStart() {
      super.onStart()
  
      // Enable Auth listener
      startAuthListener()
  
      // If user is not logged in, start the login process
      if(!sharedViewModel.isUserAuthenticated()){
          startLoginProcess()
      }
  
  }
  
  private fun initializeAuthListener() {
      mAuthStateListener = FirebaseAuth.AuthStateListener { firebaseAuth -&gt;
          if (null != firebaseAuth.currentUser) {
              // User is authenticated
              // user = firebaseAuth.currentUser
              sharedViewModel.setUser(firebaseAuth.currentUser)
              //refresh all data by calling getAllCollections, getAllPois
              sharedViewModel.refreshLocalCacheData()
  
          } else {
              // User is not signed in so kick off FirebaseUI login
              startLoginProcess()
          }
      }
  }
  
  private fun startAuthListener(){
      authService.addAuthStateListener(mAuthStateListener)
  }
  
  private fun startLoginProcess(){
      val providers = Arrays.asList(
              AuthUI.IdpConfig.EmailBuilder().build(),
              AuthUI.IdpConfig.GoogleBuilder().build())
  
      // Create and launch sign-in intent
      startActivityForResult(
              AuthUI.getInstance()
                      .createSignInIntentBuilder()
                      .setAvailableProviders(providers)
                      .build(),
              RC_SIGN_IN)
  }
  </code></pre>