16

I need for my app to login using TouchId, but I don't want the user to select or fallback into Password option. In other words I'd like to hide the 'Enter Password' label in the figure below. Thanks.

TouchId with Passcode option

3 Answers 3

27

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 for the policy....

LocalAuthentication.localizedFallbackTitle = ""

Hope this might help you..

Sign up to request clarification or add additional context in comments.

Comments

4

As far as I know there is no way to hide the password option. Although you can use the device passcode as the fall back.

Please note that the terminology "Passcode" and "Password" refers to different thing in TouchID integration.

"Password" is used for LocalAuthentication approach for integrating TouchID and refering to the applications password as fallback method.

While "Passcode" is referring to the passcode to unlock the device and authenticate purchase in app store.To use the method, you have to store some information to the device's keychain and retrieve it via Touch ID authentication.

See more about these two approaches here

iOS 9 Edit

Based on this answer, iOS 9 provide a new option to hide the passcode option.

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

Comments

3

Per documentation from 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?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.