9

I'm trying to implement Touch ID login, but when user fails more than maximum attempts, I receive this error "Error Domain=com.apple.LocalAuthentication Code=-8 "Biometry is locked out." UserInfo={NSLocalizedDescription=Biometry is locked out.}"

I want to know:

  • How much time, and where can i check it is locked touch id?
  • Is possible to force unlock without show the passcode?
  • If user fails all attempts with passcode, how much time is locked touch id, or how can I force unlock it?

Thanks!

Michel Marqués
  • 161
  • 1
  • 2
  • 10

3 Answers3

7

Touch ID, once locked-out due to incorrect tries, will be locked until the user enters the passcode. So there is no set time. The only way to unlock will be the passcode from this point onwards and there is no way to force an unlock, for obvious reasons.

Marco
  • 6,692
  • 2
  • 27
  • 38
Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99
  • But is it impossible to know how long to wait for unlock after lock it? I mean when you fail X times with biometrics and then fail X times with passcode, iPhone locks both methods, but I cant see how many time i have to wait for unlock it. – Michel Marqués Jan 31 '17 at 08:46
  • You are not informed about the amount of time the phone is locked for. There is absolutely no way to know that information. Secondly, if you are trying to determine this in your app, you're probably going about the problem the incorrect way. – Robert J. Clegg Feb 01 '17 at 08:08
  • there is no way to handle this ?? – shaqir saiyed Jan 03 '19 at 12:02
  • @shaqirsaiyed - There are ways to handle this. There is however, no way to override the security feature. – Robert J. Clegg Jan 03 '19 at 16:03
  • @RobertJ.Clegg by handle you mean we can show some alert to user right ? Like if user is locked out after few attempts then... – shaqir saiyed Jan 04 '19 at 09:20
  • @shaqirsaiyed Yeah, you could do that. However I think it would be pointless as the user would know that they're locked out - the OS displays an alert after no many wrong tried. – Robert J. Clegg Jan 04 '19 at 13:03
  • @RobertJ.Clegg ok. Though I checked when user go to settings and enter passcode once then it unlocks Touch ID. – shaqir saiyed Jan 07 '19 at 07:17
7

You can unlock the biometry by authenticating the user using passcode. Just paste this function in your project and call this function before authenticating user using Touch ID.

If it returns true run Touch ID authentication and if it fails due to biometry lock out than it will ask user to enter iPhone passcode to unlock biometry. This will happen within the app.

func isBiometryReady() -> Bool
{
    let context : LAContext = LAContext()
    var error : NSError?

    context.localizedFallbackTitle = ""
    context.localizedCancelTitle = "Enter Using Passcode"

    if context.canEvaluatePolicy(LAPolicy.deviceOwnerAuthenticationWithBiometrics, error: &error)
    {
        return true
    }

    if error?.code == -8
    {
        let reason: String = "TouchID has been locked out due to few fail attempts. Enter iPhone passcode to enable touchID."
        context.evaluatePolicy(LAPolicy.deviceOwnerAuthentication,
                               localizedReason: reason,
                               reply: { (success, error) in

            return false
        })

        return true
    }

    return false
}
ThomasW
  • 16,981
  • 4
  • 79
  • 106
Prasad Patil
  • 117
  • 1
  • 10
-1

A restart would force the use to enter the credentials and upon successfully verifying it, the lockout is withdrawn. So in a nutshell - restart your device.

JMS
  • 1
  • 1