Two Failed Attempts on iOS Biometrics Login Shows Unexpected Behavior

Overview

When using biometrics for iOS, after two failed attempts, the biometrics screen prompts users to Enter Password. After clicking the Enter Password button, the modal disappears, and nothing happens.

This article explains whether this is expected behavior and whether it is possible to allow users to enter their passwords.

Applies To

  • Biometrics for iOS
  • Enter Password

Cause

This is expected behavior from Apple.

As shown in the screenshot below, the evaluationPolicy is not configured. That means it uses the default policy .deviceOwnerAuthenticationWithBiometrics.
rtaImage (21).jpeg

  • .deviceOwnerAuthenticationWithBiometrics means that only biometric authentication is evaluated.
  • If biometrics fails for the first two times and the user clicks on “Enter Password,” then the authentication will fail.

Solution

To allow users to enter their passwords if their biometric authentication fails, set the evaluation policy to deviceOwnerAuthentication .

Here is the code:

credentialsManager.enableBiometrics(withTitle: "Authenticate to get Credentials", evaluationPolicy: .deviceOwnerAuthentication)