amplify-ui
amplify-ui copied to clipboard
feat(liveness): expose systemClockOffset to override rekognition client config
Description of changes
- Exposes the
systemClockOffset
in theFaceLivenessDetectorCore
config which will override theRekognitionStreamingClientConfig
- Developers can optionally pass this into their config to support clockSkews greater than 5 minutes (what rekognition supports by default)
https://ui.docs.amplify.aws/react/connected-components/liveness/troubleshooting
https://ui.docs.amplify.aws/react/connected-components/liveness/customization
Issue #, if available
Fixes https://github.com/aws-amplify/amplify-ui/issues/5124
Description of how you validated changes
Smoke tested - changed system clock to be ahead, behind, and aligned with server time and ran through successful checks. Also ran through unsuccessful checks with connection/regular/session timeouts.
- Change clock on device to be ahead or behind of the actual time without changing time zone (on mac go to system settings, date & time, uncheck Set date and time automatically and then change the time)
- Verify you still get the Invalid Signature Exception by removing the
systemClockOffset
from the config in LivenessDefault (lines 68/69) - Add
systemClockOffset
back - Verify you can run through a successful check
Checklist
- [x] Have read the Pull Request Guidelines
- [x] PR description included
- [x]
yarn test
passes and tests are updated/added - [x] PR title and commit messages follow conventional commit syntax
- [x] If this change should result in a version bump, changeset added (This can be done after creating the PR.) This does not apply to changes made to
docs
,e2e
,examples
, or other private packages.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.