Skip to main content

Mastering iOS Biometrics: Face ID & Touch ID

Explore the intricacies of iOS biometric authentication – Face ID and Touch ID – with a developer's guide to ranges, best practices, and integration techniques. Enhance your app security today.

Mastering iOS Biometrics: Face ID & Touch ID

Contents

In this guide

Jump to the part you need.

Mastering iOS Biometrics: Face ID & Touch ID

iOS offers robust biometric authentication options – Face ID and Touch ID – that significantly enhance app security and user experience. Understanding the underlying mechanisms, ranges, and best practices is crucial for developers aiming to leverage these features effectively. This guide dives deep into the technical aspects of iOS biometrics, providing practical insights and code examples.

Key Takeaway 1: Face ID and Touch ID provide varying levels of security and user convenience. Selecting the appropriate method depends on your app’s security requirements and target user base.

Key Takeaway 2: Understanding the LAContext framework is fundamental for integrating biometric authentication into your iOS applications.

Key Takeaway 3: Monitoring biometric authentication success rates and handling fallback mechanisms (passcode) are vital for a seamless user experience.

Key Takeaway 4: Proper error handling and user guidance are essential when dealing with biometric authentication failures.

Understanding the iOS Biometric Landscape

iOS provides two primary biometric authentication methods: Touch ID, which utilizes fingerprint scanning, and Face ID, which employs facial recognition. Both are managed through the LocalAuthentication framework, specifically the LAContext class. The key difference lies in the underlying technology and security levels. Face ID generally offers a higher level of security due to its more sophisticated mechanisms.

The LAContext class provides a consistent API for interacting with both biometric authentication methods. This abstraction simplifies integration, allowing developers to write code that works seamlessly across devices with either Touch ID or Face ID.

Technical Details: Face ID & Ranges

Face ID utilizes a TrueDepth camera system to create a detailed 3D map of the user’s face. This map is stored securely on the device’s Secure Enclave. When a user attempts to authenticate, the system compares the live scan of their face with the stored map. The system uses a matching score, and the threshold for successful authentication is quite high.

The iOS Biometric ranges for Face ID success rate vary based on device and iOS version, however, Apple states a false acceptance rate of 1 in 1,000,000. The system also adapts to changes in the user’s appearance, such as wearing glasses or growing a beard.

When working with Face ID, understanding the best result buffer size can optimize performance. While the exact size isn’t directly exposed to developers, optimizing image processing pipelines and minimizing latency can significantly improve the user experience.

Touch ID: Fingerprint Authentication

Touch ID relies on a capacitive fingerprint sensor to capture an image of the user’s fingerprint. This image is also stored securely on the Secure Enclave. Touch ID is generally faster than Face ID, but offers a slightly lower level of security.

The iOS Biometric ranges for Touch ID have a false acceptance rate of 1 in 50,000. The system can store multiple fingerprints, allowing users to authenticate with different fingers. However, the accuracy of Touch ID can be affected by factors such as dry or dirty fingers.

Code Example: Integrating Biometric Authentication

Here’s a basic code snippet demonstrating how to integrate biometric authentication using LAContext:

import LocalAuthentication

func authenticateUser() {
    let context = LAContext()
    context.localizedFallbackTitle = "Use Passcode"

    context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: "Authenticating for access") {
        (success, error) in
        if success {
            // Authentication successful
            print("Authentication Successful!")
        } else {
            // Authentication failed
            if let error = error as? LAError {
                switch error {
                case .biometryNotAvailable:
                    print("Biometry not available.")
                case .biometryLockout:
                    print("Biometry lockout.")
                case .invalidPolicyDomain:
                    print("Invalid policy domain.")
                case .notEnrolled:
                    print("User not enrolled for biometric authentication.")
                case .passcodeNotSet:
                    print("Passcode not set.")
                default:
                    print("Authentication failed: \(error.localizedDescription)")
                }
            }
        }
    }
}

Handling Fallback Mechanisms

Biometric authentication can fail for various reasons, such as a dirty sensor, a change in the user’s appearance, or a device malfunction. It’s crucial to handle these failures gracefully and provide a fallback mechanism, typically a passcode or password. The LAContext framework automatically prompts the user for a passcode if biometric authentication fails and a passcode is set on the device.

How Didit Helps

Didit's identity verification platform complements iOS biometrics by providing a robust secondary layer of authentication when needed. We can integrate seamlessly with your iOS application to offer a hybrid approach: utilize native iOS biometrics for quick access, and leverage Didit's advanced ID verification and liveness detection for high-security transactions or onboarding processes. This provides a balance of convenience and security, reducing fraud and enhancing user trust.

Ready to Get Started?

Implementing iOS biometric authentication can significantly enhance your app’s security and user experience. Explore the LocalAuthentication framework, experiment with different approaches, and prioritize a seamless user experience.

Resources:

Try it

Try this in the sandbox

Run the check this guide describes, free.

ID Verification

The product this post is about, taken from its topic. Run it free in the sandbox.

$0.15 per checkStart free

Author

Alejandro Rosas

Co-founder and CTO

Alejandro Rosas

Alejandro Rosas

Co-founder and CTO

About Didit

Questions

Blog questions

Who writes the Didit blog?
The Didit team. Guides reviewed by Alberto Rosas, co-founder and CEO, carry his byline. The rest are published as Didit.
Which topics does the blog cover?
Eight topics: ID verification, business verification (KYB), AML, sanctions and compliance, fraud prevention, transaction monitoring and crypto, country guides, agents and developers, and product updates.
Is the blog available in my language?
Yes, in 15 languages: English, Spanish, French, German, Brazilian and European Portuguese, Catalan, Russian, Arabic, Chinese, Japanese, Hindi, Indonesian, Korean and Swahili. Not every post is translated, so each language shows the posts it has.
Where do I find product updates?
In the changelog at /changelog/ and under the Product updates topic.
Are these posts legal advice?
No. Regulation posts explain rules; your legal team decides how they apply.
How do I find posts on one topic?
Open one of the eight topics, or search the blog.
Are posts dated?
Yes. Every post shows when it was published and when it was last updated.
Do posts link to the docs?
Developer posts link to the matching page on docs.didit.me and to the API reference.
Is the blog the same as the docs?
No. The blog explains rules, markets and product changes for a general reader, while docs.didit.me holds the integration guides and the API reference. Developer posts link the matching docs page and the API reference they describe.

Compliance built in

Audited, certified and attested.

We hold the certifications and build each country's rules into your flows, so you can launch anywhere without worrying. Security and Compliance center

  • Regulation encoded into your flows

    Tell us what you do and where. Didit lists the rules that apply to you, with sources, and builds the checks each country needs into one workflow.

  • Ready for AMLR

    Every requirement of the new EU anti-money laundering rules, from checking customers to human review, is already covered by a Didit check.

  • Tested in Spain's Treasury sandbox

    Spain's Treasury published its supervised sandbox report on Didit's NFC plus active liveness onboarding; SEPBLAC took part and valued the added measures positively.

  • Audited, not self-declared

    iBeta Level 1 and Level 2. Liveness tested under ISO/IEC 30107-3.

Compliance assistant

Your obligations · 3 regions

EU · AMLRCustomer due diligence, human reviewCovered
Illinois, Texas, ColoradoExplicit biometric consentCovered
Germany · Youth protectionVerified adults only (JMStV)Covered
Workflow checked. Every obligation is met
  • SOC 2 Type 2
  • ISO 27001
  • iBeta Level 1 and Level 2
  • EU regulator attestation
  • FSM youth protection
  • GDPR
  • EBA remote onboarding
  • MiCA compatible
  • FIDO Alliance member
  • AMLREU AML Regulation ready

Integration · Didit MCP

Run Didit from your own AI agent

Connect Didit to Claude, Cursor, VS Code or ChatGPT and just ask in plain words. Your agent can do anything you can do in the console, with the same permissions you have.

Add to ClaudeChatGPT
Didit Academy · Lesson 04 · Use Didit with MCP
  • Build workflowsDescribe the checks you need. The agent creates and publishes the flow.
  • Run investigationsAsk why a session was declined, review cases, search people and companies.
  • Change rulesCreate payment rules, test them on past data and switch them on.
  • Pull reportsAsk for numbers, exports or the audit log.

Verify your first user today.

Start free

Free sandbox. Credit applies to work-email sign-ups.