Local Authentication

RSS for tag

Authenticate users biometrically or with a passphrase using Local Authentication.

Posts under Local Authentication tag

75 Posts

Post

Replies

Boosts

Views

Activity

Crash on launch. Possibly LAContext/LAClient causing the crash.
Hey, I've been trying to pinpoint what is causing this crash, but I'm having troubles understanding the Apple Crash log. I understand that this crash is happening after the app is launched, because I know we call canEvaluatePolicy() and evaluatePolicy() when the login screen finished loading. But if you notice, the following error lines after that are not related to LocalAuthentication (or so I think), therefore I'm confused. Here's the log: Thread 0 Crashed: 0 libsystem_platform.dylib 0x0000000217f95fc4 _platform_strlen + 4 1 Foundation 0x00000001a803539c -[NSXPCEncoder _encodeInvocation:isReply:into:] + 132 (NSXPCCoder.m:456) 2 Foundation 0x00000001a800686c -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 1388 (NSXPCConnection.m:1506) 3 CoreFoundation 0x00000001a680270c ___forwarding___ + 1128 (NSForwarding.m:3618) 4 CoreFoundation 0x00000001a6801a60 _CF_forwarding_prep_0 + 96 5 LocalAuthentication 0x00000001dd83c6b4 __64-[LAClient evaluatePolicy:options:uiDelegate:synchronous:reply:]_block_invoke + 240 (LAClient.m:541) 6 LocalAuthentication 0x00000001dd83bc80 __47-[LAClient _performSynchronous:callId:finally:]_block_invoke + 584 (LAClient.m:441) 7 libdispatch.dylib 0x00000001a64d4a2c _dispatch_client_callout + 20 (object.m:560) 8 libdispatch.dylib 0x00000001a64e42d4 _dispatch_sync_invoke_and_complete + 56 (queue.c:1028) 9 LocalAuthentication 0x00000001dd83b9e8 -[LAClient _performSynchronous:callId:finally:] + 220 (LAClient.m:460) 10 LocalAuthentication 0x00000001dd83c57c -[LAClient evaluatePolicy:options:uiDelegate:synchronous:reply:] + 392 (LAClient.m:540) 11 LocalAuthentication 0x00000001dd842d48 -[LAContext _evaluatePolicy:options:log:cid:synchronous:reply:] + 472 (LAContext.m:340) 12 LocalAuthentication 0x00000001dd838364 -[LAContext _evaluatePolicy:options:log:cid:error:] + 284 (LAContext.m:387) 13 LocalAuthentication 0x00000001dd838090 -[LAContext canEvaluatePolicy:error:] + 304 (LAContext.m:533) 14 APIGuard 0x0000000101fbb144 0x101fac000 + 61764 15 APIGuard 0x0000000101fb99b8 0x101fac000 + 55736 16 CoreFoundation 0x00000001a67ff324 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 28 (CFNotificationCenter.c:652) 17 CoreFoundation 0x00000001a689bac4 ___CFXRegistrationPost_block_invoke + 52 (CFNotificationCenter.c:173) 18 CoreFoundation 0x00000001a686ecc0 _CFXRegistrationPost + 456 (CFNotificationCenter.c:199) 19 CoreFoundation 0x00000001a681539c _CFXNotificationPost + 728 (CFNotificationCenter.c:1147) 20 Foundation 0x00000001a7fdc704 -[NSNotificationCenter postNotificationName:object:userInfo:] + 96 (NSNotification.m:560)
8
0
5.0k
Sep ’22
Check for Touch ID with the lid closed and a Magic Keyboard with Touch ID
Hey all 👋🏼 Is there any API change required for supporting the Touch ID sensor of an external Magic Keyboard with Touch ID (on a Mac with Apple silicon)? Currently we rely on canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics for checking if TouchID is present on a system, but this seems to be returning false when the laptop is closed/clamshell mode even with the Magic Keyboard with Touch ID connected to it. Any suggestions? The code snippet that we use for checking is: int isTouchIDAvailable() { int result = 0; bool success = [[[LAContext alloc] init] canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]; if (success) { return 1; } return 0; }
3
0
1.8k
Aug ’22
Biometry does not block on Face ID failure attempts on iPhone 13 Pro Max
Hello mates, I am having an issue while disabling user's biometry on iPhone 13 Pro Max. When I performs multiple failed recognition wrong attempts through Face ID, device Biometry does not get locked. I want to have some custom functionality after Biometry locking. This issue is only on iPhone 13 Pro Max whereas its working fine on physical iPhone 13 Pro. Had anyone this issue faced?. Any help would be appreciated. Thanks, Dawood gul
0
0
1.6k
Jun ’22
Detecting masked Face ID enrolment via evaluatedPolicyDomainState
Hi, iOS 15.4 is bringing a new exciting security feature which allows users to enroll "masked face" so they can unlock their devices while wearing a mask. Some apps might leverage evaluatedPolicyDomainState (https://developer.apple.com/documentation/localauthentication/lacontext/1514150-evaluatedpolicydomainstate) to detect if the biometric state has changed, and if so, logging out/locking the user to protect their data. Looks like the masked-face enrolment changes the policy domain state as such it might lead to many unexpected logouts. Is there any way to detect if the change to the state was introduced by the masked face enrollment as such we can somehow retain the user's login session? Many thanks!
1
0
2.1k
May ’22
Can You Store FaceID Data On Your Own Database?
Is there any way to store the biometric information/data points that faceid collects in your own database? I know it's possible to allow users to log in using faceID on their own phones, however, is it possible to leverage facial recognition and make it a feature in my app? For instance, allowing any user to log into my app on any iphone just by scanning their face...
2
0
3.2k
Feb ’22
iOS 15 with FaceID authentication error when resetting FaceID
We use biometricID (faceID/touchID) authentication to access to a secret stored in keychain. We create the access control object with the biometryCurrentSet option as shown to make sure if FaceID / TouchID changes the entry should be invalidated. let secAccessControlObj = SecAccessControlCreateWithFlags(nil, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, .biometryCurrentSet, accessControlError) Below is the set and get query, Set Query: [String(kSecClass): kSecClassGenericPassword,         String(kSecAttrAccount): group as AnyObject,         String(kSecAttrService): service as AnyObject,         String(kSecUseAuthenticationUI) : kSecUseAuthenticationUIAllow as AnyObject,         String(kSecAttrAccessControl) : secAccessControlObj,         String(kSecValueData) : value as AnyObject,         String(kSecAttrCreationDate) : Date() as AnyObject] Get Query: [String(kSecClass): kSecClassGenericPassword,         String(kSecAttrAccount): group as AnyObject,         String(kSecAttrService): service as AnyObject,         String(kSecUseAuthenticationUI) : kSecUseAuthenticationUIAllow as AnyObject,         String(kSecAttrAccessControl) : secAccessControlObj,         String(kSecValueData) : value as AnyObject,         String(kSecAttrCreationDate) : Date() as AnyObject] Steps: Set the value in keychain using the set query above Reset the faceID Use the get query to get the value from keychain by authenticating against TouchID/ FaceID. Result: When we try to get the value from keychain using SecItemCopyMatching(query as CFDictionary, result) we get the error code errSecAuthFailed (-25293) on iOS 15. Analysis: Prior to this (iOS 14 and below) the error code would be errSecItemNotFound which makes more sense. This is an issue for iOS 15 only as we also get errSecAuthFailed when user backgrounds the app while authenticating with FaceID/TouchID. This creates a ambiguity for us. In our testing when we backgrounded the app while authentication is in progress, we found the actual call to SecItemCopyMatching(::) was made when app's state was actually active but when the call returned the state had become background and the error code was again errSecAuthFailed This seems to be a bug with iOS 15 as it creates a ambiguity for the caller. I think the error code returned after resetting faceID should still be errSecItemNotFound in which case we can know the secret is actually lost since FaceID is reset and can treat errSecAuthFailed as error where the secret is actually not lost but just that failed temporarily. Please let us know if we need to file a bug
2
0
3.2k
Feb ’22
[Face ID] Identify if faceid with mask is enabled
With the new feature enabled in ios beta 15.4, I can validate that faceID with mask works. We get a bool(matched/unmatched) response when using evaluatePolicy, which is not helpful in finding if faceid-with-mask was used. I want to disable the face id feature of the app when a non-secure way of authentication is enabled and I'm unable to find any documentation on this on LAPolicy's page. What would be the recommended way to go around finding if face id with mask is enabled? Any help with documentation would be appreciated. Thanks!
0
0
1.1k
Feb ’22
canEvaluatePolicy incorrect when Apple Watch is in Sleep Mode
Hi there, Our Password Manager app on macOS allows a user to unlock their password database using Apple Watch for convenience. We check that Apple Watch is available for use by calling canEvaluatePolicy in the usual way. This works really well most of the time, if the Watch is available, we'll be able to call evaluatePolicy to have the user authenticate with their watch. However, we have been receiving reports that when their watches go to sleep our App incorrectly requests they authenticate with their watch. It does this because canEvaluatePolicy returns true, but once we call evaluatePolicy instead of requesting the user authenticate, we immediately get an error: Error Domain=com.apple.LocalAuthentication Code=-1 "AppleWatch authentication failed." UserInfo={NSDebugDescription=AppleWatch authentication failed., NSLocalizedDescription=Authentication failure.} Apparently though there is a way to detect this, the Apple User Login screen is able to detect that the watch is asleep and requests a password instead. Also System Preferences that require a password somehow can cause the Apple Watch to vibrate when asleep but then fails gracefully/falls back to requesting a password. As developers, we would like to know if we can request Apple Watch authentication using the canEvaluatePolicy function. If the watch is asleep, then that should we believe return false. Any help or pointers on how to detect this scenario appreciated.
0
0
1.1k
Feb ’22
Safari Extensions and FaceID/Keychain access
My Safari Extension on iOS needs access to a Keychain item (password) that is secured by the userPresence and devicePasscode flag. In other words, FaceID/TouchID or the device PIN is necessary to access the password. Is there a way for the extension to access the password? SafariWebExtensionHandler.swift has access to the Keychain, but can't present FaceID/TouchID/device PIN interface to the user. Popup.js has UI access, but can't access the iOS Keychain. One hack is to set touchIDAuthenticationAllowableReuseDuration of the Keychain item to an arbitrary time and have the user authenticate in the containing app. However, in case of a time-out, the containing app has be opened by the extension with a custom URL scheme. openURL is not accessible in SafariWebExtensionHandler.swift either (I assume it can be handled by popup.js). This is a user-unfriendly solution. What is the best way to give the Safari extension access to a Keychain item?
0
0
1.7k
Dec ’21
Integrate Passkey iCloud Keychain with other smartphone-based FIDO authenticator
Hi Developers, I am wondering how is it possible for other smartphone-based FIDO authenticators to use the same iCloud Keychain storage as Passkey does so those credentials can be used on non-apple devices too, and also on the smartphone at the same time. There are some other iOS authenticators that have implemented BLE and are working on all devices including Windows, but the problem is that those apps cannot support signing in to the website on the smartphone itself (neither in apps nor inside the browser) using the previously registered credential of 'cross-platform' type.
1
0
2.0k
Dec ’21
Crash on launch. Possibly LAContext/LAClient causing the crash.
Hey, I've been trying to pinpoint what is causing this crash, but I'm having troubles understanding the Apple Crash log. I understand that this crash is happening after the app is launched, because I know we call canEvaluatePolicy() and evaluatePolicy() when the login screen finished loading. But if you notice, the following error lines after that are not related to LocalAuthentication (or so I think), therefore I'm confused. Here's the log: Thread 0 Crashed: 0 libsystem_platform.dylib 0x0000000217f95fc4 _platform_strlen + 4 1 Foundation 0x00000001a803539c -[NSXPCEncoder _encodeInvocation:isReply:into:] + 132 (NSXPCCoder.m:456) 2 Foundation 0x00000001a800686c -[NSXPCConnection _sendInvocation:orArguments:count:methodSignature:selector:withProxy:] + 1388 (NSXPCConnection.m:1506) 3 CoreFoundation 0x00000001a680270c ___forwarding___ + 1128 (NSForwarding.m:3618) 4 CoreFoundation 0x00000001a6801a60 _CF_forwarding_prep_0 + 96 5 LocalAuthentication 0x00000001dd83c6b4 __64-[LAClient evaluatePolicy:options:uiDelegate:synchronous:reply:]_block_invoke + 240 (LAClient.m:541) 6 LocalAuthentication 0x00000001dd83bc80 __47-[LAClient _performSynchronous:callId:finally:]_block_invoke + 584 (LAClient.m:441) 7 libdispatch.dylib 0x00000001a64d4a2c _dispatch_client_callout + 20 (object.m:560) 8 libdispatch.dylib 0x00000001a64e42d4 _dispatch_sync_invoke_and_complete + 56 (queue.c:1028) 9 LocalAuthentication 0x00000001dd83b9e8 -[LAClient _performSynchronous:callId:finally:] + 220 (LAClient.m:460) 10 LocalAuthentication 0x00000001dd83c57c -[LAClient evaluatePolicy:options:uiDelegate:synchronous:reply:] + 392 (LAClient.m:540) 11 LocalAuthentication 0x00000001dd842d48 -[LAContext _evaluatePolicy:options:log:cid:synchronous:reply:] + 472 (LAContext.m:340) 12 LocalAuthentication 0x00000001dd838364 -[LAContext _evaluatePolicy:options:log:cid:error:] + 284 (LAContext.m:387) 13 LocalAuthentication 0x00000001dd838090 -[LAContext canEvaluatePolicy:error:] + 304 (LAContext.m:533) 14 APIGuard 0x0000000101fbb144 0x101fac000 + 61764 15 APIGuard 0x0000000101fb99b8 0x101fac000 + 55736 16 CoreFoundation 0x00000001a67ff324 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 28 (CFNotificationCenter.c:652) 17 CoreFoundation 0x00000001a689bac4 ___CFXRegistrationPost_block_invoke + 52 (CFNotificationCenter.c:173) 18 CoreFoundation 0x00000001a686ecc0 _CFXRegistrationPost + 456 (CFNotificationCenter.c:199) 19 CoreFoundation 0x00000001a681539c _CFXNotificationPost + 728 (CFNotificationCenter.c:1147) 20 Foundation 0x00000001a7fdc704 -[NSNotificationCenter postNotificationName:object:userInfo:] + 96 (NSNotification.m:560)
Replies
8
Boosts
0
Views
5.0k
Activity
Sep ’22
Check for Touch ID with the lid closed and a Magic Keyboard with Touch ID
Hey all 👋🏼 Is there any API change required for supporting the Touch ID sensor of an external Magic Keyboard with Touch ID (on a Mac with Apple silicon)? Currently we rely on canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics for checking if TouchID is present on a system, but this seems to be returning false when the laptop is closed/clamshell mode even with the Magic Keyboard with Touch ID connected to it. Any suggestions? The code snippet that we use for checking is: int isTouchIDAvailable() { int result = 0; bool success = [[[LAContext alloc] init] canEvaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics error:nil]; if (success) { return 1; } return 0; }
Replies
3
Boosts
0
Views
1.8k
Activity
Aug ’22
IOS app without user authentication page
Hi, I am developing an app which will auto assign a generated id to the user when using the app for the first time. So the user will not need to log in on a login screen. And this generated id will be used for the identification purpose when communicating to back-end server. is this acceptable by Apple? Thanks
Replies
0
Boosts
0
Views
1k
Activity
Jul ’22
Biometry does not block on Face ID failure attempts on iPhone 13 Pro Max
Hello mates, I am having an issue while disabling user's biometry on iPhone 13 Pro Max. When I performs multiple failed recognition wrong attempts through Face ID, device Biometry does not get locked. I want to have some custom functionality after Biometry locking. This issue is only on iPhone 13 Pro Max whereas its working fine on physical iPhone 13 Pro. Had anyone this issue faced?. Any help would be appreciated. Thanks, Dawood gul
Replies
0
Boosts
0
Views
1.6k
Activity
Jun ’22
Detecting masked Face ID enrolment via evaluatedPolicyDomainState
Hi, iOS 15.4 is bringing a new exciting security feature which allows users to enroll "masked face" so they can unlock their devices while wearing a mask. Some apps might leverage evaluatedPolicyDomainState (https://developer.apple.com/documentation/localauthentication/lacontext/1514150-evaluatedpolicydomainstate) to detect if the biometric state has changed, and if so, logging out/locking the user to protect their data. Looks like the masked-face enrolment changes the policy domain state as such it might lead to many unexpected logouts. Is there any way to detect if the change to the state was introduced by the masked face enrollment as such we can somehow retain the user's login session? Many thanks!
Replies
1
Boosts
0
Views
2.1k
Activity
May ’22
Can You Store FaceID Data On Your Own Database?
Is there any way to store the biometric information/data points that faceid collects in your own database? I know it's possible to allow users to log in using faceID on their own phones, however, is it possible to leverage facial recognition and make it a feature in my app? For instance, allowing any user to log into my app on any iphone just by scanning their face...
Replies
2
Boosts
0
Views
3.2k
Activity
Feb ’22
iOS 15 with FaceID authentication error when resetting FaceID
We use biometricID (faceID/touchID) authentication to access to a secret stored in keychain. We create the access control object with the biometryCurrentSet option as shown to make sure if FaceID / TouchID changes the entry should be invalidated. let secAccessControlObj = SecAccessControlCreateWithFlags(nil, kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly, .biometryCurrentSet, accessControlError) Below is the set and get query, Set Query: [String(kSecClass): kSecClassGenericPassword,         String(kSecAttrAccount): group as AnyObject,         String(kSecAttrService): service as AnyObject,         String(kSecUseAuthenticationUI) : kSecUseAuthenticationUIAllow as AnyObject,         String(kSecAttrAccessControl) : secAccessControlObj,         String(kSecValueData) : value as AnyObject,         String(kSecAttrCreationDate) : Date() as AnyObject] Get Query: [String(kSecClass): kSecClassGenericPassword,         String(kSecAttrAccount): group as AnyObject,         String(kSecAttrService): service as AnyObject,         String(kSecUseAuthenticationUI) : kSecUseAuthenticationUIAllow as AnyObject,         String(kSecAttrAccessControl) : secAccessControlObj,         String(kSecValueData) : value as AnyObject,         String(kSecAttrCreationDate) : Date() as AnyObject] Steps: Set the value in keychain using the set query above Reset the faceID Use the get query to get the value from keychain by authenticating against TouchID/ FaceID. Result: When we try to get the value from keychain using SecItemCopyMatching(query as CFDictionary, result) we get the error code errSecAuthFailed (-25293) on iOS 15. Analysis: Prior to this (iOS 14 and below) the error code would be errSecItemNotFound which makes more sense. This is an issue for iOS 15 only as we also get errSecAuthFailed when user backgrounds the app while authenticating with FaceID/TouchID. This creates a ambiguity for us. In our testing when we backgrounded the app while authentication is in progress, we found the actual call to SecItemCopyMatching(::) was made when app's state was actually active but when the call returned the state had become background and the error code was again errSecAuthFailed This seems to be a bug with iOS 15 as it creates a ambiguity for the caller. I think the error code returned after resetting faceID should still be errSecItemNotFound in which case we can know the secret is actually lost since FaceID is reset and can treat errSecAuthFailed as error where the secret is actually not lost but just that failed temporarily. Please let us know if we need to file a bug
Replies
2
Boosts
0
Views
3.2k
Activity
Feb ’22
[Face ID] Identify if faceid with mask is enabled
With the new feature enabled in ios beta 15.4, I can validate that faceID with mask works. We get a bool(matched/unmatched) response when using evaluatePolicy, which is not helpful in finding if faceid-with-mask was used. I want to disable the face id feature of the app when a non-secure way of authentication is enabled and I'm unable to find any documentation on this on LAPolicy's page. What would be the recommended way to go around finding if face id with mask is enabled? Any help with documentation would be appreciated. Thanks!
Replies
0
Boosts
0
Views
1.1k
Activity
Feb ’22
canEvaluatePolicy incorrect when Apple Watch is in Sleep Mode
Hi there, Our Password Manager app on macOS allows a user to unlock their password database using Apple Watch for convenience. We check that Apple Watch is available for use by calling canEvaluatePolicy in the usual way. This works really well most of the time, if the Watch is available, we'll be able to call evaluatePolicy to have the user authenticate with their watch. However, we have been receiving reports that when their watches go to sleep our App incorrectly requests they authenticate with their watch. It does this because canEvaluatePolicy returns true, but once we call evaluatePolicy instead of requesting the user authenticate, we immediately get an error: Error Domain=com.apple.LocalAuthentication Code=-1 "AppleWatch authentication failed." UserInfo={NSDebugDescription=AppleWatch authentication failed., NSLocalizedDescription=Authentication failure.} Apparently though there is a way to detect this, the Apple User Login screen is able to detect that the watch is asleep and requests a password instead. Also System Preferences that require a password somehow can cause the Apple Watch to vibrate when asleep but then fails gracefully/falls back to requesting a password. As developers, we would like to know if we can request Apple Watch authentication using the canEvaluatePolicy function. If the watch is asleep, then that should we believe return false. Any help or pointers on how to detect this scenario appreciated.
Replies
0
Boosts
0
Views
1.1k
Activity
Feb ’22
Safari Extensions and FaceID/Keychain access
My Safari Extension on iOS needs access to a Keychain item (password) that is secured by the userPresence and devicePasscode flag. In other words, FaceID/TouchID or the device PIN is necessary to access the password. Is there a way for the extension to access the password? SafariWebExtensionHandler.swift has access to the Keychain, but can't present FaceID/TouchID/device PIN interface to the user. Popup.js has UI access, but can't access the iOS Keychain. One hack is to set touchIDAuthenticationAllowableReuseDuration of the Keychain item to an arbitrary time and have the user authenticate in the containing app. However, in case of a time-out, the containing app has be opened by the extension with a custom URL scheme. openURL is not accessible in SafariWebExtensionHandler.swift either (I assume it can be handled by popup.js). This is a user-unfriendly solution. What is the best way to give the Safari extension access to a Keychain item?
Replies
0
Boosts
0
Views
1.7k
Activity
Dec ’21
Integrate Passkey iCloud Keychain with other smartphone-based FIDO authenticator
Hi Developers, I am wondering how is it possible for other smartphone-based FIDO authenticators to use the same iCloud Keychain storage as Passkey does so those credentials can be used on non-apple devices too, and also on the smartphone at the same time. There are some other iOS authenticators that have implemented BLE and are working on all devices including Windows, but the problem is that those apps cannot support signing in to the website on the smartphone itself (neither in apps nor inside the browser) using the previously registered credential of 'cross-platform' type.
Replies
1
Boosts
0
Views
2.0k
Activity
Dec ’21