Touch ID is Apple’s biometric fingerprint authentication technology, which was introduced with the iPhone 5s. In iOS 8, it is now possible to locally authenticate users by making use of Touch ID. This article describes how to use Local Authentication framework to authenticate an iOS 8 application.
Touch ID was introduced in iOS 7 as a means of authenticating the user. It can be used similar to a passcode authentication.
In iOS7, it was limited to
But in iOS 8, it is possible to integrate Touch ID in third party applications using the Local Authentication API.
Note: Currently It is not possible to use Local Authentication to authenticate from a remote server.
The following is required for a developer to implement the Touch ID in their applications:
Xcode 6.x and iOS 8.x – Apple’s Xcode 6 and iOS 8 APIs need to be installed and configured on the developer’s computer.
iOS 8 Device – An iOS device running the latest version of iOS 8 for testing (Touch ID is available only on iPhone 5S and greater)
Fingerprint and passcode – Device should be registered with at least one fingerprint and passcode should be turned on.
How to add Fingerprint and Passcode
Touch ID requires that you set up a passcode to serve as an alternative security method just in case your fingerprint is ever unable to access your phone.
To use Touch ID with the Local Authentication API, there are a few functions that we can use. These are detailed below:
There are a few caveats with using Local Authentication, which are listed below:
Local Authentication provides a new standard user interface for authentication. In the case of Touch ID, this is an alert view with two buttons as illustrated below. One button to cancel, and one to use the fallback means of authentication. There is also a custom message that must be set. It is a good practice to use this to explain to the user why Touch ID authentication is required.
The Objective-C code snippet :
The Swift code snippet:
As the name indicates, Local Authentication framework can only be used for authenticating the applications locally. Currently it is not possible to authenticate to a remote server.
An iOS 8 device is capable of registering a maximum five fingerprints. With any of the registered fingerprint user can authenticate the application. There is no way to restrict the authentication for a particular fingerprint only.
Image Source- Macrumors.com
(Amarnath Reddy works as Software Engineer at [x]cubeLABS. He has over 3 years of experience in iOS and Mobile Web Application Development.)
Tags: Apple App