TouchId function without password

I need a login application using TouchId, but I don’t want the user to select or return a password in the Password parameter. In other words, I would like to hide the "Enter Password" label in the image below. Thanks.

TouchId with Passcode option

+6
source share
3 answers

As far as I know, there is no way to hide the password. Although you can use the access code for the device as a return.

Note that the terminology “Access Code” and “Password” refers to another thing in TouchID integration.

A "password" is used for the LocalAuthentication approach to integrate TouchID and access the application password as a fallback method.

While the "Access Code" refers to the access code to unlock the device and authenticate the purchase in the application store. To use this method, you need to save some information in the device key chain and obtain it by checking the Touch ID.

Read more about these two approaches here.

iOS 9 Change

Based on this answer , iOS 9 provides a new opportunity to hide the access code option.

For iOS 9, two new policies have been added that do not return to the password. These policies are kSecAccessControlTouchIDAny and kSecAccessControlTouchIDCurrentSet

+5
source

The answer is yes . You can hide the "Enter Password" ...

Try the following code snippet,

var LocalAuthentication = LAContext() LocalAuthentication.localizedFallbackTitle = "" // Add this line if LocalAuthentication.canEvaluatePolicy(LAPolicy.DeviceOwnerAuthenticationWithBiometrics, error: &errorMsg){ 

Add this line before checking the policy ....

LocalAuthentication.localizedFallbacktitle = ""

Hope this helps you.

+11
source

In the documentation for LocalAuthentication.LAContext:

 /// Fallback button title. /// @discussion Allows fallback button title customization. A default title "Enter Password" is used when /// this property is left nil. If set to empty string, the button will be hidden. open var localizedFallbackTitle: String? 
+2
source

Source: https://habr.com/ru/post/983677/


All Articles