TechnologiesSecurity, Privacy & Authentication

LocalAuthentication

iOSmacOStvOSwatchOSvisionOS

LocalAuthentication lets your app authenticate users with biometrics — Touch ID, Face ID, or Optic ID — or fall back to the device passcode. You create an LAContext, evaluate an LAPolicy against it, and inspect LABiometryType and LADomainState to determine which biometric mechanisms are available and whether the enrolled state has changed; failures surface as LAError. The framework also models authorization through LARight and LARightStore, with supporting types such as LAPersistedRight, LAAuthenticationRequirement, and LABiometryFallbackRequirement, and represents protected material with LASecret, LAPrivateKey, and LAPublicKey. It is available on iOS, macOS, watchOS, and visionOS.

Essentials 3

Create an authentication context and evaluate biometric or passcode policies against it.

  • Cl
    LAContextmacOS 10.10+
    Class that represents an authentication context.
  • En
    LAPolicymacOS 10.10+
    Constants that specify the authentication policy a context evaluates.
  • Cl
    LAEnvironmentmacOS 15.0+
    An object that reports the local authentication capabilities and settings of the current environment.

Biometric and Domain State 5

Inspect which biometric mechanisms are available and whether the enrolled state has changed.

  • En
    LABiometryTypemacOS 10.13.2+
    Constants that identify the type of biometry the device supports, such as Touch ID or Face ID.
  • Cl
    LADomainStatemacOS 15.0+
    An object that captures the device authentication state, including biometric and companion details.
  • Cl
    LADomainStateBiometrymacOS 15.0+
    An object that describes the current biometric enrollment state for a context.
  • Cl
    LADomainStateCompanionmacOS 15.0+
    An object that describes the state of a paired companion device used for authentication.
  • En
    LACompanionTypemacOS 15.0+
    Constants that identify the type of companion device available for authentication.

Authorization Rights 6

Model and persist the authorization required to perform protected operations.

  • Cl
    LARightmacOS 13.0+
    @brief Groups a set of requirements that need to be satisfied in order to grant access to certain resource or operation
  • Cl
    LAPersistedRightmacOS 13.0+
    @brief A type of right that, when authorized, grants access to a key and secret
  • Cl
    LARightStoremacOS 13.0+
    @brief Persistent storage for @c LARight instances.
  • Cl
    LAAuthenticationRequirementmacOS 13.0+
    @brief Builds requirements that can be used for protecting a @c LARight
  • Cl
    LABiometryFallbackRequirementmacOS 13.0+
    @brief Builds authentication requirements that can be used as fallbacks for biometric authentication
  • En
    LAAccessControlOperationmacOS 10.11+
    Constants that specify the operation an access-control protected item is evaluated for.

Protected Material 4

Represent secrets and cryptographic keys guarded by local authentication.

  • Cl
    LASecretmacOS 13.0+
    @brief Generic secret
  • Cl
    LAPrivateKeymacOS 13.0+
    @brief Managed Private Key.
  • Cl
    LAPublicKeymacOS 13.0+
    @brief The public part of an asymmetric key pair
  • En
    LACredentialTypemacOS 10.11+
    Constants that identify the kind of credential used during authentication.

Errors 1

Handle failures reported during authentication and policy evaluation.

  • St
    LAErrormacOS 10.10+
    A structure that describes errors that occur during authentication or policy evaluation.

Structures 1

  • St
    LocalAuthenticationView
    Compact authentication view providing authentication similar to `LAContext`
← Security, Privacy & Authentication