Documentation Hub
Mobile SDK
Mobile SDK
  • Keyless SDK Documentation
  • Introduction
    • 🧩Components
    • ⚙️Integration Flows
    • 🤳Sample Apps
  • 📱Mobile SDK Guide
    • 1️⃣ Getting started
    • 2️⃣ Enrollment
    • 3️⃣ Authentication
    • 4️⃣ De-Enrollment
    • 5️⃣ Backup
    • 6️⃣ User and device management
  • 📱Mobile SDK Reference
    • UI Customization
    • Error handling
    • Liveness Settings
    • JWT signing
    • PIN authentication
    • Introduce Keyless to Users
    • Photo Enrollment
  • 📱Mobile SDK Use Cases
    • Account recovery
    • Dynamic Linking
  • 📒Mobile SDK Changelog
    • Changelog
  • 💽Server API
    • Getting Started
    • Users
    • Devices
    • Operations
Powered by GitBook
On this page
  • Photo Enrollment configuration
  • Photo Enrollment success result

Was this helpful?

  1. Mobile SDK Reference

Photo Enrollment

Use a photo (from an identity document) to enroll the initial biometric data of the user

Last updated 6 days ago

Was this helpful?

As introduce in the :

enrollment is the process of registering a new user by connecting their facial biometrics to a Keyless account. During this process, a full and unobstructed view of the user's face is required.

If you possess a trusted source, such as an identity document, Keyless allows you to register a new user connecting their facial biometric from the identity document photo. The assumption behind the feature is that the identity document photo fulfills the requirement of a full and unobstructed view of the user's face.

To retrieve a document photo Keyless offers the utility.

To enroll a user from the photo use the PhotoEnrollConfig.

// photoBitmap is the bitmap you created from the document photo.
val configuration = PhotoEnrollConfig(photo = photoBitmap)

Keyless.enroll(
  configuration = configuration,
  onCompletion = { result ->
    when (result) {
      is Keyless.KeylessResult.Success -> Log.d("KeylessSDK ", "Enroll success - userId ${result.value.keylessId}")
      is Keyless.KeylessResult.Failure -> Log.d("KeylessSDK ", "Enroll failure - error code ${result.error.code}")
    }
  }
)
// photoUIImage is the UIImage you created from the document photo.
let configuration = PhotoEnrollConfig(photo: photoUIImage)

Keyless.enroll(
  configuration: configuration,
  onCompletion: { result in
    switch result {
    case .success(let enrollmentSuccess):
        print("Enrollment finished successfully. UserID: \(enrollmentSuccess.keylessId)")
    case .failure(let error):
        print("Enrollment finished with error: \(error.message)
    }
  })
import 'package:keyless_flutter_sdk/keyless.dart';
import 'package:keyless_flutter_sdk/models/configurations/enrollment_configuration.dart';

// photoPath is the path where you stored the document photo.
final configuration = PhotoEnrollConfig(photoPath: photoPath);

try {
  final result = await Keyless.instance.enroll(configuration);
  print("Enrollment finished successfully. UserID: ${result.keylessId}");
} catch (error) {
  print("Enrollment finished with error: $error");
}

Photo Enrollment configuration

You can configure the enrollment process with optional parameters in your PhotoEnrollConfig() instance.

public data class PhotoEnrollConfig(
    public val photo: Bitmap,
    public val temporaryState: String? = null,
    public val operationInfo: OperationInfo? = null,
    public val jwtSigningInfo: JwtSigningInfo? = null
)
public struct PhotoEnrollConfig{
    public let photo: CGImage
    public let operationInfo: Keyless.OperationInfo?
    public let jwtSigningInfo: JwtSigningInfo?
    public let temporaryState: String?
}
class PhotoEnrollConfig{
  final String photoPath;
  final String? temporaryState;
  final OperationInfo? operationInfo;
  final JwtSigningInfo? jwtSigningInfo;
}

Photo Enrollment success result

If the Enroll from photo is successful you will find in the EnrollmentSuccess containing the corresponding fields you requested during configuration.

data class EnrollmentSuccess(
    val signedJwt: String? = null,
) : KeylessSdkSuccess()
public struct EnrollmentSuccess {
    public let signedJwt: String?
}
class EnrollmentSuccess {
    final String? signedJwt;
}

If the enrollment is successful the user is enrolled and can with Keyless from now on.

📱
enrollment section
Keyless Mobile Document SDK
authenticate