Skip to content

Syncano/syncano-socket-aws-face-auth

Repository files navigation

Syncano Socket aws-face-auth

CircleCI

This socket integrates face authentication with aws rekognition to Syncano.

Install

syncano-cli add aws-face-auth

Dependencies

  • rest-auth socket

    Since there can be no authentication without first registering to a system, it is important to use the rest-auth socket for basic registration.

    Link to rest-auth socket documentation

Socket Documentation

Link to aws-face-auth socket documentation

Endpoints

create-collection

This endpoint creates a collection where face indexes will be stored in AWS Rekognition.

Parameters

Name Type Description Example
collectionId string ID for the collection that you are creating SyncanoFaces

Response

{
  "collectionArn": "12345",
  "statusCode": 200
}

delete-collection

This endpoint deletes a collection in AWS Rekognition.

Parameters

Name Type Description Example
collectionId string ID for the collection that you are deleting SyncanoFaces

Response

{
  "statusCode": 200
}

face-register

This endpoint register's a face to an existing user account for face authentication.

Parameters

User required to input password as extra check when registering face to account.

Name Type Description Example
username string User email you@domain.com
password string User password user-password
collectionId string Id collection to keep indexed image SyncanoFaces
image string Path to image or an S3 object key image.jpg
bucketName string Name of s3 bucket. Leave empty if image not on s3 bucket s3-bucket.

Response

{
  message: "User face registered for face authentication."
}

face-login

This endpoint login a user using face image.

Parameters

Name Type Description Example
collectionId string Id collection to keep indexed image SyncanoFaces
image string Path to image or an S3 object key image.jpg
bucketName string Name of s3 bucket. Leave empty if image not on s3 bucket s3-bucket.

Response

{
  token: "cb21ff98ac8c7dda8fcd01",
  username: "you@domain.com"
}

remove-face-auth

This endpoint removes face authentication on user account

Parameters

Name Type Description Example
username string User email you@domain.com
token string User token cb21fac8c7dda8fcd0129b0adb0254dea5c8e
collectionId string Id collection to keep indexed image SyncanoFaces
image string Path to image or an S3 object key image.jpg
bucketName string Name of s3 bucket. Leave empty if image not on s3 bucket s3-bucket.

Response

{
  message: "User account removed from face authentication."
}

verify-face-auth

This endpoint checks if face authentication is enabled on user account

Parameters

Name Type Description Example
username string User email you@domain.com
token string User token cb21fac8c7dda8fcd0129b0adb0254dea5c8e

Response

{
  message: "Face auth enabled on user account.",
  is_face_auth: true
}

Contributing

How to Contribute

  • Fork this repository
  • Clone from your fork
  • Make your contributions (Make sure your work is well tested)
  • Create Pull request from the fork to this repo

Setting up environment variables

  • Create a .env on parent folder
  • Copy contents of .env-sample file to newly created .env file and assign appropriate values to the listed variables.

Testing

  • Ensure all your test are written on the test directory
  • Use the command npm test to run test

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published