Android One Tap Sign In: Unable to show Password Save Dialog

Viewed 372

I'm trying to implement Android One Tap Sign In and I'm unable to show this dialog here:

Password Save Dialog

I keep getting the msg: com.google.android.gms.common.api.ApiException: 16: Skipping password saving since the user is likely prompted with Android Autofill.

How can I fix this?

Code:

private fun saveCredentials(email: String, password: String) {
    val signInPassword = SignInPassword(email, password)
    val savePasswordRequest =
        SavePasswordRequest.builder().setSignInPassword(signInPassword).build()

    // Show the password save dialog
    Identity.getCredentialSavingClient(this)
        .savePassword(savePasswordRequest)
        .addOnFailureListener {e ->
            Log.d(TAG, Log.getStackTraceString(e))
        }
        .addOnSuccessListener { result ->
            startIntentSenderForResult(
                result.pendingIntent.intentSender,
                REQUEST_CODE_SAVE_CREDENTIALS,
                null,   // fillInIntent
                0,      // flagsMask
                0,      // flagsValues
                0,      // extraFlags
                null)   // options
        }
}

Documentation: https://developers.google.com/identity/one-tap/android/save-passwords

3 Answers

I found out that the save password dialog from One Tap Sign In will show only if you turn OFF the autofill service on your phone. You can do this by going to Settings > Languages & input > Advanced > Autofill Service.

If autofill is ON you will get the save pw dialog from the autofill service that looks a bit outdated compared to the one provided by the One Tap library.

I also met---->: The save prompt is disabled for the current app. To restore, remove this app from the "Never save" list in the Smart Lock for Passwords settings for all accounts on this device.

It is likely because of google exponential cooldown feature. Here you can find the explanation about it.

To solve it you can try two options:

  1. Toggle on/off the cool down going to the Dialer app (the app to make calls) and input the following code: *#*#66382723#*#* .

  2. If you closed the save dialog one time, go to Settings > Google Setting > Manage Account > Security > Settings > delete the app from the banned list.

I hope it helps.

Related