This repository offers a UI component for Amazon Rekognition Face Liveness, enabling developers to ensure that only authentic users, and not bad actors using spoofs, can access their services.
If the liveness check screen and open and dismissed quickly several times, it's possible to run into a race condition wherein the AVCaptureSession.startRunning() while it is being configured which results in the following error
'NSGenericException', reason: '*** -[AVCaptureSession startRunning] startRunning may not be called between calls to beginConfiguration and commitConfiguration'
Resolution:
Start the AVCaptureSession in a queue that has a higher QoS
Add additional code to cleanup and dispose of the AVCaptureVideoPreviewLayer and its associate AVCaptureSession
In Flutter app, depending on the integration, it's possible to dismiss the Liveness Check screen by swiping away the view if the integration doesn't support fullscreen mode; add code to stop recording if the view disappears.
The requester of the issue was able to test and verify the fix with their Flutter app.
Check points: (check or cross out if not relevant)
[x] Added new tests to cover change, if needed
[x] Build succeeds with all target using Swift Package Manager
[x] All unit tests pass
[x] Security oriented best practices and standards are followed (e.g. using input sanitization, principle of least privilege, etc)
[x] Documentation update for the change if required
[x] PR title conforms to conventional commit style
[x] If breaking change, documentation/changelog update with migration instructions
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Issue #, if available: https://github.com/aws-amplify/amplify-ui-swift-liveness/issues/68 Description of changes: Root cause:
If the liveness check screen and open and dismissed quickly several times, it's possible to run into a race condition wherein the
AVCaptureSession.startRunning()
while it is being configured which results in the following errorResolution:
The requester of the issue was able to test and verify the fix with their Flutter app.
Check points: (check or cross out if not relevant)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.