Lightweight AFIS utilizing ONYX
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.iron
app
bin
build
config
.gitignore
README.md

README.md

API REFERENCE

ENROLL

The enroll endpoint will perform an identify to prevent enrolling a duplicate fingerprint. If there is no match, the fingerprint template supplied will be inserted into the database and a new fingerprintId will be generated and returned. If there is a match, the fingerprintId of the matching fingerprint will be returned and the supplied fingerprint template will not be saved.

Fingerprint Template

/api/v1/onyx/enroll

Required parameters

parameter type description
api_key string This key is generated for the admin user created the first time the application is run. Retrieve this value from api_keys collection of the app MongoDB
template base64encoded string A base64 encoded string containing the binary data of the fingerprint template generated by the Onyx SDK on a mobile device.

WSQ Image

/api/v1/onyx/wsq/enroll

Required parameters

parameter type description
api_key string This key is generated for the admin user created the first time the application is run. Retrieve this value from api_keys collection of the app MongoDB
wsqImage base64encoded string A base64 encoded string containing the binary data of a WSQ fingerprint image generated by the Onyx SDK on a mobile device.

Enroll Result

key type description
success boolean true if the provided fingerprint template was inserted into the MongoDB. false if a duplicate fingerprint was found.
fingerprintId string new fingerprintId if success was true, fingerprintId of the duplicate fingerprint if success was false
message string Result message. 'Successfully enrolled fingerprint.' or 'Duplicate fingerprint found.'

IDENTIFY

The identify endpoint will query the entire database for a matching fingerprint. If there is a match, the fingerprintId of the matching fingerprint will be returned. If there is NOT a match, success will be false

Fingerprint Template

/api/v1/onyx/identify

Required parameters

parameter type description
api_key string This key is generated for the admin user created the first time the application is run. Retrieve this value from api_keys collection of the app MongoDB
template base64encoded string A base64 encoded string containing the binary data of the fingerprint template generated by the Onyx SDK on a mobile device.

WSQ Image

/api/v1/onyx/wsq/identify

Required parameters

parameter type description
api_key string This key is generated for the admin user created the first time the application is run. Retrieve this value from api_keys collection of the app MongoDB
wsqImage base64encoded string A base64 encoded string containing the binary data of a WSQ fingerprint image generated by the Onyx SDK on a mobile device.

Identify Result

key type description
success boolean true if the provided fingerprint template matched a fingerprint in the database. false if no matching fingerprint was found.
fingerprintId string Will be defined and value will be the matching fingerprintId if success was true, undefined if success was false
score number Will be defined and value will be the matching score if success was true, undefined if success was false
message string Result message. 'No match found.' or 'Found a matching fingerprintId'

VERIFY

The verify endpoint will perform a one-to-one match of the provided fingerprint template with that of the provided fingerprintId.

Fingerprint Template

/api/v1/onyx/verify

Required parameters

parameter type description
api_key string This key is generated for the admin user created the first time the application is run. Retrieve this value from api_keys collection of the app MongoDB
template base64encoded string A base64 encoded string containing the binary data of the fingerprint template generated by the Onyx SDK on a mobile device.
fingerprintId string The primary key of a fingerprint template stored in the app's MongoDB.

WSQ Image

/api/v1/onyx/wsq/verify

Required parameters

parameter type description
api_key string This key is generated for the admin user created the first time the application is run. Retrieve this value from api_keys collection of the app MongoDB
wsqImage base64encoded string A base64 encoded string containing the binary data of a WSQ fingerprint image generated by the Onyx SDK on a mobile device.
fingerprintId string The primary key of a fingerprint template stored in the app's MongoDB.

Verify Result

key type description
isVerified boolean Result of the verification.
score number The numerical score of the match result.

VECTOR

The vector endpoint will perform a one-to-many match of the provided fingerprint template against the database templates represented by the provided fingerprint IDs.

Fingerprint Template

/api/v1/onyx/vector

Required parameters

parameter type description
api_key string This key is generated for the admin user created the first time the application is run. Retrieve this value from api_keys collection of the app MongoDB
template base64encoded string A base64 encoded string containing the binary data of the fingerprint template generated by the Onyx SDK on a mobile device
fingerprintIds Array<string> An array of primary keys that will be used to create a FingerprintTemplateVector for verification

WSQ Image

/api/v1/onyx/wsq/vector

Required parameters

parameter type description
api_key string This key is generated for the admin user created the first time the application is run. Retrieve this value from api_keys collection of the app MongoDB
wsqImage base64encoded string A base64 encoded string containing the binary data of a WSQ fingerprint image generated by the Onyx SDK on a mobile device
fingerprintIds Array<string> An array of primary keys that will be used to create a FingerprintTemplateVector for verification

Vector Result

key type description
success boolean true if the provided fingerprint template matched a fingerprint in the vector. false if no matching fingerprint was found.
fingerprintId string Will be defined and value will be the matching fingerprintId if success was true, undefined if success was false
score number Will be defined and value will be the matching score if success was true, undefined if success was false
message string Result message. 'No match found.' or 'Found a matching fingerprintId'

Server Setup (Ubuntu 14.04LTS)

Install Node.js

node v4.6.2 REQUIRED

sudo npm cache clean -f
sudo npm install -g n
sudo n 4.6.2

Install MongoDB https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-ubuntu/

Install MeteorJS

curl https://install.meteor.com/ | sh

Install Forever

sudo npm install forever -g

Clone the project

git clone https://

Install the Onyx node module

cd ~/path/to/onyx-afis/app

**Make sure you're in the ../../app directory**

npm install

**Note: if node-gyp installation has errors, may need to do the following command**
sudo apt-get install node-gyp

cd node_modules/onyx-node/

Follow the instructions in onyx-node/README.md or https://www.npmjs.com/package/onyx-node

IDKit can be found at ~/path/to/onyx-afis/bin/

Verify onyx-node setup

cd ~/path/to/onyx-afis/app/node_modules/onyx-node/sample/

node onyx-verify-sample.js

Build / Deploy

cd onyx-afis/app

meteor build --directory ../build/

cd ../config/production/

source env.sh

cd ../../build/bundle/programs/server/

npm install

cd ../../

forever -a -l OnyxAFIS.log -o OnyxAFISOut.log -e OnyxAFISErrors.log start main.js

Restart Server

cd ~/path/to/onyx-afis/config/production/

source env.sh

cd ../../build/bundle/

forever -a -l OnyxAFIS.log -o OnyxAFISOut.log -e OnyxAFISErrors.log start main.js

Verify deployment

mongo OnyxAFIS

db.api_keys.find().pretty()

Sample output

> db.api_keys.find().pretty()
{
	"_id" : "4BaSXiH2xHAzMy7nP",
	"owner" : "8wBx8xzBET5q5shkY",
	"key" : "51f6b93bf5f20e192195e9bc9879fd98"
}
>

copy the "key" value

Paste the api key into the enroll.js and verify.js files

exit

cd ~/path/to/onyx-afis/bin/test/

npm install

vi enroll.js

vi verify.js

paste the api key value into the requestJson.api_key make sure the localhost:port is correct for the request url save the changes and exit

Test Enroll

node enroll.js

Sample output

body: { fingerprintId: 'Y6qG46CQnfCxfJ2iJ',
  success: true,
  message: 'Successfully enrolled fingerprint.' }

copy the fingerprintId

Error Message

Will return the ID of the existing matched fingerprint in the database.

body: { fingerprintId: 'QPvKAADjbQD54NEXQ',
  success: false,
  message: 'Duplicate fingerprint found.' }

Test Verify

vi verify.js

Edit verify.js and insert the fingerprintId into the requestJson.

node verify.js

Sample output

body: { isVerified: true, score: 9339 }

Error message

onyx-afis/bin/test$ node verify.js
body: { error:
   { error: 'not-enrolled',
     reason: 'No fingerprint enrolled.',
     message: 'No fingerprint enrolled. [not-enrolled]',
     errorType: 'Meteor.Error' },
  message: 'Error executing onyx verification.' }