DevTechie

DevTechie.com is all about sharing knowledge by practical means. We focus on solving real world challenges via code.

Member-only story

User Authentication with Face ID/Touch ID in SwiftUI

DevTechie
DevTechie
Published in
4 min readDec 22, 2021

--

Authentication is important to keep your user’s information safe but asking for a username and password every time they land on your app can spoil the experience. Face ID or Touch ID (AKA. Biometric Authentication) provides a convenient way to authenticate users without the need to enter a username and password.

Your app users can rely on biometric authentication like Face ID or Touch ID to enable secure, effortless access to the app. As a fallback option, and for devices without biometry, passcode or password serves a similar purpose.

LocalAuthentication is the framework used to leverage these mechanisms in your app and to extend authentication procedures your app already implements. This framework wraps biometric authentication functionality and gives you access to an easy-to-use API that can be used for user authentication.

To maximize security, Apple never gives your app access to any of the underlying authentication data. You can’t access any fingerprint images or face recognition data. User’s biometric information is saved in a hardware-based security processor called “The Secure Enclave” which keeps this information isolated from the rest of the system and manages the data out of reach even of the operating system.

You can specify a particular policy and provide messaging that tells the user why you want them to authenticate. The framework then coordinates with the Secure Enclave to carry out the operation. Afterward, you receive only a…

--

--

DevTechie
DevTechie

Published in DevTechie

DevTechie.com is all about sharing knowledge by practical means. We focus on solving real world challenges via code.

No responses yet