Skip to content

Applying changes to support Binding with fallback when the biometrics…#147

Merged
george-bafaloukas-forgerock merged 2 commits intodevelopfrom
SDKS-4935_DeviceBinding_Allow_Fallback
Apr 24, 2026
Merged

Applying changes to support Binding with fallback when the biometrics…#147
george-bafaloukas-forgerock merged 2 commits intodevelopfrom
SDKS-4935_DeviceBinding_Allow_Fallback

Conversation

@george-bafaloukas-forgerock
Copy link
Copy Markdown
Contributor

@george-bafaloukas-forgerock george-bafaloukas-forgerock commented Apr 15, 2026

Applying changes to support Binding with fallback when the biometrics are not set on the device. Adding more tests and code comments explaining the functionality

JIRA Ticket

JIRA "[iOS][Unified]Investigate DeviceBinding BiometricWithFallback not working when Passcode is set and Biometrics is disabled"

Description

Biometric & Passcode Logic Improvements
Dynamic Access Control: In BiometricDeviceCredentialAuthenticator, the code now checks if biometrics are available before creating keys.

If biometrics are enrolled: Uses [.biometryAny, .or, .devicePasscode].

If no biometrics: Uses only .devicePasscode.

Fix for Creation Failures: By switching from .biometryCurrentSet to .biometryAny, the SDK prevents the Secure Enclave from rejecting key creation on devices where biometrics aren't configured yet.

2. Security & State Tracking
Biometric Domain State: Added biometricDomainState (of type Data?) to the UserKey model. This captures a "snapshot" of the device's biometric enrollment at the time of binding.

Tamper Detection: During the sign operation, the authenticator compares the current biometric state with the stored state. If they differ (e.g., a new fingerprint was added), the key is deleted and the user is forced to re-bind for security.

Backward Compatibility: The UserKey initializer now defaults the state to nil, ensuring existing keys created on older versions of the SDK continue to work without triggering the state check.

3. Project & Housekeeping
New Tests: Added BiometricDeviceCredentialAuthenticatorTests.swift to the project and build phases.

Documentation: Significantly improved the header documentation in the authenticator class to explain the security model and hardware-vs-software invalidation.

Checklist:

  • I ran all unit tests and they pass
  • I added test case coverage for my changes

… are not set on the device. Adding more tests and code comments explaining the functionality
Copy link
Copy Markdown
Contributor

@vahancouver vahancouver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@george-bafaloukas-forgerock george-bafaloukas-forgerock merged commit c69e36c into develop Apr 24, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants