This sample, built using AWS Amplify, is meant to showcase recommended flows when using Amazon Rekognition for Identity Verification. There are two key components in this sample:
- Frontend: A React/NextJS web application for exercising the key flows
- Backend: An GraphQL based backend built using AWS AppSync
Users interested in implemented Identity Verification with Amazon Rekognition should consider the following flows.
- Check face image quality via the DetectFaces API.
- Use SearchFacesByImage API against the collection(s) to check for any duplicate registration.
- Index the face image using IndexFaces API and use the ExternalImageID (Social Security number or a similar unique ID) parameter to associate the face embeddings with the ExternalImageID.
- Store the face image in the S3 bucket along with the user metadata (face-id returned from the IndexFaces API, SSN and S3 URL) in DynamoDB. The SSN or a unique person identifier can be used as a key to lookup S3 URL and the face-id.
- Check face image quality via the DetectFaces API.
- Check face image quality of face on Id card via the DetectFaces API.
- Use CompareFaces API to ensure that the face on the supplied Id card and the face on the selfie match.
- Use SearchFacesByImage API against the collection(s) to check for any duplicate registration.
- Index the face image using IndexFaces API and use the ExternalImageID (Social Security number or a similar unique ID) parameter to associate the face embeddings with the ExternalImageID.
- Store the face image in the S3 bucket along with the user metadata (face-id returned from the IndexFaces API, SSN and S3 URL) in DynamoDB. The SSN or a unique person identifier can be used as a key to lookup S3 URL and the face-id.
- Check face image quality via the DetectFaces API.
- Search against the collection with SearchFacesbyImage API. If there is a face match, then return the use the faceId to return additional data about the user by cross-referencing against profile data in DynamoDB.
- Install npm
First you'll need to install npm, if you don't already have it installed. Please see npm docs for information on installing npm.
- Install Amplify
Next, if you don't have the AWS Amplify CLI installed, please follow the instructions at AWS Amplify - Installation.
Simply click on the link below:
- Clone the git repo on your local machine
git clone https://github.com/aws-samples/amazon-rekognition-id-verification-sample-with-amplify
- Switch to the cloned directory and run
npm update
cd amazon-rekognition-id-verification-sample-with-amplify
npm update --legacy-peer-deps
The --legacy-peer-deps
flag is required by a package used in the sample.
- Initialize Amplify
amplify init
- Deploy the backend
amplify push
- Deploy the frontend
amplify add hosting
amplify publish
For more details on hosting/publishing, please see Add hosting to your app. The Amplify Getting Started page has detailed instructions on working with Amplify.
- Create a user in the Cognito User Pool attached to the app.
- Accessing the web endpoint. Amplify allows you
See CONTRIBUTING for more information.
This library is licensed under the MIT-0 License. See the LICENSE file.