AWS recently launched the Amazon Rekognition Face Liveness feature. This new feature helps deter fraud in facial verification.
-
With AWS Amplify you could easily plug Face liveness detection on your Android/IOS/Browser. It currently supports the below frameworks:
-
This solution allows you to integrate Amazon Rekognition face liveness with your existing Angular Application. It uses the FaceLivenessDetector component from React and wraps it as an Angular Component.
-
FaceLivenessDetector component is responsible from starting the liveness session. Once the results are ready it notifies us via callback functions.
npm install -g @aws-amplify/cli
amplify configure
- Clone this project
git clone <TODO add path>
- Open a new terminal. From the root of the project, run:
amplify init
- Install Project dependencies. Fire the below command in a terminal from the root of your project foler
npm install
- Add Cognito Authentication. Fire the below command in a terminal from the root of your project folder
amplify add auth
- Push your changes
amplify push
-
Verify if aws-exports.ts file has all the Auth details. We reference properties from this file when generating creadentials to communicate with Amazon Rekognition.
-
Update IAM permissions. Search for IAM role of type 'amplify-{your-app-name}-{environment}-{random-number}-authRole' generated by amplify and add the below inline policy that supports liveness detection features
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "rekognition:StartFaceLivenessSession",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "rekognition:CreateFaceLivenessSession",
"Resource": "*"
},
{
"Effect": "Allow",
"Action": "rekognition:GetFaceLivenessSessionResults",
"Resource": "*"
}
]
}
- To run on local machine
ng serve
- To view the hosted application on Amplify
amplify console