Keyless Class
This class implements the Keyless mobile API.
The Keyless class controls the device’s camera during enrollment and authentication, to capture the user’s face, image processing, to extract biometric features from the user’s face, for all interactions with the Keyless network to authenticate the user and to store and retrieve authentication tokens.
To configure the Keyless class using Keyless.configure(...), the caller uses the delegate parameter, which is an instance of KeylessDelegateProtocol. This delegate will receive callbacks on the enrollment progress/completion/failure. The class configuration also requires the API key, which is provided by Keyless. Finally, the class can be optionally configured to enable active liveness detection during enrollment and authentication using the numberOfLivenessChallenges parameter of the Keyless.configure(...) function (passive liveness detection is enabled by default). After configuration, the caller can interact with the Keyless class through its shared instance Keyless.shared.
The Keyless mobile API can operate in legacy mode (deprecated), or in custom token mode. In legacy mode, the Keyless mobile API generates and handles the authentication secrets internally. The API generates a unique authentication token after each successful biometric authentication. The token is cryptographically bound to the user identity (Keyless ID) and to a string specified by the caller during authentication.
In this mode, the enrollment status is KeylessStatus.enrolled(...). The main entry points for the Keyless mobile API are:
  • The enrollment method Keyless.enroll(...), which captures the user’s face and establishes a unique user identifier (Keyless ID).
  • The token retrieval method Keyless.getAuthenticationToken(...), which captures the user’s face, and returns an authentication token.
In custom token mode, the Keyless mobile API allows users to safely store an opaque custom token during enrollment, and to later retrieve it as a result of a successful authentication. To set the Keyless mobile API in custom token mode, enrollment must be performed using Keyless.enrollCustomToken(...). The custom token can be retrieved using Keyless.getCustomAuthenticationToken(). In custom token mode, the enrollment status is KeylessStatus.enrolledCustomToken.
Once the user has enrolled, the API mode can only be changed by de-enrolling and re-enrolling the user.
Export as PDF
Copy link