Skip to content

LocalAuthentication iOS xcode9 beta1

Vincent Dondain edited this page Jun 5, 2017 · 2 revisions

#LocalAuthentication.framework

diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAContext.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAContext.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAContext.h	2017-02-20 18:58:01.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAContext.h	2017-05-20 02:04:49.000000000 -0400
@@ -144,7 +144,7 @@
     ///             LocalAuthentication will not show password entry user interface.
     ///             When entered from the LocalAuthentication user interface, the password is stored as
     ///             UTF-8 encoded string.
-    LACredentialTypeApplicationPassword __TVOS_UNAVAILABLE = 0,
+    LACredentialTypeApplicationPassword __TVOS_AVAILABLE(11.0) = kLACredentialTypeApplicationPassword,
 } NS_ENUM_AVAILABLE(10_11, 9_0) __WATCHOS_AVAILABLE(3.0) __TVOS_AVAILABLE(10.0);
 
 /// Sets a credential to this context.
@@ -160,7 +160,7 @@
 /// @return YES if the credential was set successfully, NO otherwise.
 ///
 - (BOOL)setCredential:(nullable NSData *)credential
-                 type:(LACredentialType)type NS_AVAILABLE(10_11, 9_0) __WATCHOS_AVAILABLE(3.0) __TVOS_UNAVAILABLE;
+                 type:(LACredentialType)type NS_AVAILABLE(10_11, 9_0) __WATCHOS_AVAILABLE(3.0) __TVOS_AVAILABLE(11.0);
 
 /// Reveals if credential was set with this context.
 ///
@@ -168,7 +168,7 @@
 ///
 /// @return YES on success, NO otherwise.
 ///
-- (BOOL)isCredentialSet:(LACredentialType)type NS_AVAILABLE(10_11, 9_0) __WATCHOS_AVAILABLE(3.0) __TVOS_UNAVAILABLE;
+- (BOOL)isCredentialSet:(LACredentialType)type NS_AVAILABLE(10_11, 9_0) __WATCHOS_AVAILABLE(3.0) __TVOS_AVAILABLE(11.0);
 
 typedef NS_ENUM(NSInteger, LAAccessControlOperation)
 {
@@ -234,6 +234,18 @@
                         reply:(void(^)(BOOL success, NSError * __nullable error))reply
                         NS_AVAILABLE(10_11, 9_0) __WATCHOS_AVAILABLE(3.0) __TVOS_UNAVAILABLE;
 
+/// Executes the specified block in the given queue. Internal components that can take advantage of the
+/// LAContext (e.g. Keychain or SecKeys) will get access to it while the block is being executed.
+///
+/// @discussion The block is executed asynchronously.
+///
+/// @param block A block to be executed.
+///
+/// @param queue A queue to be used for the execution of the block.
+- (void)withCurrentContextExecute:(void(^)())block
+                            queue:(dispatch_queue_t)queue
+                            API_AVAILABLE(macos(10.13), ios(11.0), watchos(4.0), tvos(11.0));
+
 /// 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.
@@ -284,6 +296,25 @@
 /// @see LATouchIDAuthenticationMaximumAllowableReuseDuration
 @property (nonatomic) NSTimeInterval touchIDAuthenticationAllowableReuseDuration NS_AVAILABLE(10_12, 9_0) __WATCHOS_UNAVAILABLE __TVOS_UNAVAILABLE;
 
+/// Allows setting the default localized authentication reason on context.
+///
+/// @discussion A localized string from this property is displayed in the authentication UI if the caller didn't specify
+///             its own authentication reason (e.g. a keychain operation with kSecUseAuthenticationContext). This property
+///             is ignored if the authentication reason was provided by caller.
+@property (nonatomic, copy) NSString *localizedReason API_AVAILABLE(macos(10.13), ios(11.0)) API_UNAVAILABLE(watchos, tvos);
+
+/// Allows running authentication in non-interactive mode.
+///
+/// @discussion If the context is used in a keychain query by the means of kSecUseAuthenticationContext,
+///             then setting this property to YES has the same effect as passing kSecUseNoAuthenticationUI
+///             in the query, i.e. the keychain call will eventually fail with errSecInteractionNotAllowed
+///             instead of displaying the authentication UI.
+///
+///             If this property is used with a LocalAuthentication evaluation, it will eventually fail with
+///             LAErrorNotInteractive instead of displaying the authentication UI.
+@property (nonatomic) BOOL interactionNotAllowed;
+
+
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h	2017-02-24 03:31:45.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAError.h	2017-05-28 01:10:10.000000000 -0400
@@ -14,19 +14,19 @@
     LAErrorAuthenticationFailed = kLAErrorAuthenticationFailed,
     
     /// Authentication was canceled by user (e.g. tapped Cancel button).
-    LAErrorUserCancel           = kLAErrorUserCancel,
+    LAErrorUserCancel = kLAErrorUserCancel,
     
     /// Authentication was canceled, because the user tapped the fallback button (Enter Password).
-    LAErrorUserFallback         = kLAErrorUserFallback,
+    LAErrorUserFallback = kLAErrorUserFallback,
     
     /// Authentication was canceled by system (e.g. another application went to foreground).
-    LAErrorSystemCancel         = kLAErrorSystemCancel,
+    LAErrorSystemCancel = kLAErrorSystemCancel,
     
     /// Authentication could not start, because passcode is not set on the device.
-    LAErrorPasscodeNotSet       = kLAErrorPasscodeNotSet,
+    LAErrorPasscodeNotSet = kLAErrorPasscodeNotSet,
 
     /// Authentication could not start, because Touch ID is not available on the device.
-    LAErrorTouchIDNotAvailable  = kLAErrorTouchIDNotAvailable,
+    LAErrorTouchIDNotAvailable = kLAErrorTouchIDNotAvailable,
     
     /// Authentication could not start, because Touch ID has no enrolled fingers.
     LAErrorTouchIDNotEnrolled = kLAErrorTouchIDNotEnrolled,
@@ -34,16 +34,21 @@
     /// Authentication was not successful, because there were too many failed Touch ID attempts and
     /// Touch ID is now locked. Passcode is required to unlock Touch ID, e.g. evaluating
     /// LAPolicyDeviceOwnerAuthenticationWithBiometrics will ask for passcode as a prerequisite.
-    LAErrorTouchIDLockout   NS_ENUM_AVAILABLE(10_11, 9_0) __WATCHOS_AVAILABLE(3.0) __TVOS_AVAILABLE(10.0) = kLAErrorTouchIDLockout,
+    LAErrorTouchIDLockout NS_ENUM_AVAILABLE(10_11, 9_0) __WATCHOS_AVAILABLE(3.0) __TVOS_AVAILABLE(10.0) = kLAErrorTouchIDLockout,
 
     /// Authentication was canceled by application (e.g. invalidate was called while
     /// authentication was in progress).
-    LAErrorAppCancel        NS_ENUM_AVAILABLE(10_11, 9_0) = kLAErrorAppCancel,
+    LAErrorAppCancel NS_ENUM_AVAILABLE(10_11, 9_0) = kLAErrorAppCancel,
 
     /// LAContext passed to this call has been previously invalidated.
-    LAErrorInvalidContext   NS_ENUM_AVAILABLE(10_11, 9_0) = kLAErrorInvalidContext
+    LAErrorInvalidContext NS_ENUM_AVAILABLE(10_11, 9_0) = kLAErrorInvalidContext,
+
+    
+    /// Authentication failed, because it would require showing UI which has been forbidden
+    /// by using interactionNotAllowed property.
+    LAErrorNotInteractive API_AVAILABLE(macos(10.10), ios(8.0), watchos(3.0), tvos(10.0)) = kLAErrorNotInteractive,
 } NS_ENUM_AVAILABLE(10_10, 8_0) __WATCHOS_AVAILABLE(3.0) __TVOS_AVAILABLE(10.0);
 
 /// LocalAuthentication error domain.
 extern NSString *const __nonnull LAErrorDomain
-NS_AVAILABLE(10_10_3, 8_3) __WATCHOS_AVAILABLE(3.0) __TVOS_AVAILABLE(10.0);
+NS_AVAILABLE(10_11, 8_3) __WATCHOS_AVAILABLE(3.0) __TVOS_AVAILABLE(10.0);
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAPublicDefines.h /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAPublicDefines.h
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAPublicDefines.h	2016-10-06 02:42:51.000000000 -0400
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LAPublicDefines.h	2017-05-28 01:10:10.000000000 -0400
@@ -17,9 +17,7 @@
 #define kLAOptionAuthenticationReason                       2
 
 // Credential types
-#define kLACredentialTypePasscode                          -1
-#define kLACredentialTypePassphrase                        -2
-#define kLACredentialCTKPIN                                -3
+#define kLACredentialTypeApplicationPassword                1
 
 // Error codes
 #define kLAErrorAuthenticationFailed                       -1
@@ -32,6 +30,8 @@
 #define kLAErrorTouchIDLockout                             -8
 #define kLAErrorAppCancel                                  -9
 #define kLAErrorInvalidContext                            -10
+#define kLAErrorNotInteractive                          -1004
+
 
 // Error domain
 #define kLAErrorDomain        "com.apple.LocalAuthentication"
diff -ruN /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LocalAuthentication.apinotes /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LocalAuthentication.apinotes
--- /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LocalAuthentication.apinotes	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode9-beta1.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/LocalAuthentication.framework/Headers/LocalAuthentication.apinotes	2017-05-28 01:10:10.000000000 -0400
@@ -0,0 +1,5 @@
+---
+Name: LocalAuthentication
+Tags:
+- Name: LAError
+  NSErrorDomain: LAErrorDomain
Clone this wiki locally