customerID . Your customer API_KEY , mandatory (we provide these credentials)
face_idMandatory in the Validation process, this face_id is returned in the Onboarding of a specific User. Then when a Selfie validation is required, this is the way to validate a user against her face_id. This parameter is empty when we call an Onboarding a new user.
callback Mandatory: Your “callback URL”, with a unique ID to identify the user’s transaction in the response.
action Mandatory: "onboarding" or "validate"
onboarding Perform a new user Selfie Onboarding and get the face_id of this new user.
validate Perform a selfie validation, of an existing user (with an existing face_id), previuosly onboarded. Call this method on Password Recovery, validate transactions, or verify that the user is on front of the webcam.
3) Callback
To get the result of the Selfie Validation or the Selfie Onboarding, just implement a POST data endpoint.
Response parameters
success . Boolean, true if the Selfie was made successful
data A Form Data object with the following fields.
Selfie OnBoarding Form Data Response
success:true,//true if the Selfie is a real user error_code:0,// 0 == no errors error:"",// error description in case of error user_id:"XXXXXXXX"// face_id, store this ID on your DB an associate to // the user, to perform future selfie validations
importorg.springframework.util.MultiValueMap;importorg.springframework.web.bind.annotation.PostMapping;importorg.springframework.web.bind.annotation.RestController;importorg.springframework.web.bind.annotation.RequestBody;@RestControllerpublicclassAndiaController { @PostMapping("/onboarding")publicvoidonboarding(@RequestBodyMultiValueMap<String,String> values) {if(values.get("success").equals("true")){// Redirect to login page } else {// Redirect to signup page with error message// values.get("message") } }}
var express =require('express');var app =express();app.post('/onboarding',function (req, res) {if (req.body.success ==="true") {// Redirect to login page } else {// Redirect to signup page with error message// req.body.message }})var server =app.listen(8081,function () {var host =server.address().addressvar port =server.address().portconsole.log("Example app listening at http://%s:%s", host, port)})
require'rubygems'require'sinatra'post '/onboarding'doif params.success=="true"# Redirect to login pageelse# Redirect to signup page with error message# params.messageendend
from flask import Flask, redirectapp =Flask(__name__)@app.route("/onboarding", methods = ['POST'])defonboarding():if request.form['success']=="true":# Redirect to login pageelse:# Redirect to signup page with error message# request.form['message']if__name__=="__main__": app.run(host='0.0.0.0', port=8081)
Selfie Validation Form Data Response
success:true,//true if the Selfie is a Match agains the given face_id error_code:0,// != 0 if there is an error error:"",// error description if error_code != 0 message:"It is a Match"// description
importorg.springframework.util.MultiValueMap;importorg.springframework.web.bind.annotation.PostMapping;importorg.springframework.web.bind.annotation.RestController;importorg.springframework.web.bind.annotation.RequestBody;@RestControllerpublicclassAndiaController { @PostMapping("/validate")publicvoidvalidate(@RequestBodyMultiValueMap<String,String> values) {if(values.get("success").equals("true")){// Generate JWT and redirect to home page } else {// Redirect to login page with error message// values.get("message") } }}
[Route("api/[controller]")]publicclassAndiaController:Controller{ [HttpPost]publicActionResultValidate([FromBody] Dictionary<string,string> values)) {if (ModelState.IsValid) {try {if(values.GetValueOrDefault("success").Equals("true")){ // Generate JWT and redirect to home page } else { // Redirect to login page with error message // values.GetValueOrDefault("message") } }catch (Exception e) {return BadRequest(e); } }return BadRequest(ModelState); }}
var express =require('express');var app =express();app.post('/valiate',function (req, res) {if (req.body.success ==="true") {// Generate JWT and redirect to home page } else {// Redirect to login page with error message// values.GetValueOrDefault("message") }})var server =app.listen(8081,function () {var host =server.address().addressvar port =server.address().portconsole.log("Example app listening at http://%s:%s", host, port)})
require'rubygems'require'sinatra'post '/validate'doif params.success=="true"# Generate JWT and redirect to home pageelse# Redirect to login page with error message# params.messageendend
from flask import Flask, redirectapp =Flask(__name__)@app.route("/onboarding", methods = ['POST'])defonboarding():if request.form['success']=="true":# Generate JWT and redirect to home pageelse:# Redirect to login page with error message# request.form['message']if__name__=="__main__": app.run(host='0.0.0.0', port=8081)