User Id Validation & Partner Params

SIDMetadata

SIDMetada is an object used to send two different kinds of metadata the first one being the User id information and partner parameters which can be associated with jobs to instantiate the metadata object you do the below

//Instantiation
SIDMetadata metadata = new SIDMetadata();
//To get the user id information
SIDUserIdInfo userIdInfo = metadata.getSidUserIdInfo();
//To get the partner parameters
PartnerParams params = metadata.getPartnerParams();

Below are the use case for the metadata and association with job

User Id Validation

ID card data can be set using SIDUserIdInfo object. It uses a declarative mechanism. Setting ID card infos, this should be set prior to start ID card capture.

Step 1: Create the use SIDUserIdInfo object which is a child object of SIDMetadata

SIDMetadata metadata = new SIDMetadata();
SIDUserIdInfo userIdInfo = metadata.getSidUserIdInfo();

Step 2 : Once the SIDUserIdInfo is available there are a couple of methods which can be called to set the user info as required

//For setting first name
userIdInfo.setFirstName("firstName")
//For setting last name
userIdInfo.setLastName("lastName")
//For setting middle name
userIdInfo.setMiddleName("middleName")
//For setting country
userIdInfo.setCountry("country")
//For setting id type
userIdInfo.setIdType("idType")
//For setting id number
userIdInfo.setIdNumber("idNumber")
//For setting email
userIdInfo.setEmail("email")

Step 3: For any optional or extra information that may be associated with the userIdInfo there is a method which can be used to add or remove additional information

//add additional information
userIdInfo.additionalValue("key","value");
//remove additional information
userIdInfo.removeAdditionalValue("name")

Step 4: Set the metadata object to the job's config

//Instantiate the SIDConfig builder and set the metadata
SIDConfig.Builder sidConfig = new SIDConfig.Builder(this)
.....
.setSIDMetadata(metadata)
.....
.build(tag);

Step 5: Submit the job

//Instantiate SIDNetworkRequest object to send
SIDNetworkRequest mSINetworkrequest = new SIDNetworkRequest(this);
...
...
...
//submit the job
mSINetworkrequest.submit(sidConfig);

Modify Partner Parameters

Partner Parameters allow you to add any additional information that you would like associated with the job. This information will come back as a JSON object in results send from the Smile Identity server. A common use case for this is to add your own unique ID to track the job as it relates to a user/instance in your own system. All fields in the partner_params must be Strings.

To modify or add additional data to the PartnerParams JSON (see Partner Parameters)

First you need to get an instance of PartnerParams from the SIDMetadata class.

SIDMetadata metadata = new SIDMetadata();
PartnerParams params = metadata.getPartnerParams();

2) You can call these methods to add predefined partner params data.

//set the user id
params.setUserId("your user if");
//set the enrolled job id
params.setEnrolledJobId("job id");
//set the job type
params.setJobType(int jobType);

3) To add additional values other than those predefined to the entry (the method can be chained)

//set additional value key pair
params.additionalValue("key1","value1").additionalValue("key2","value2");

4) To remove an additional value (For instance the key named name4) use:

//remove additional
params.removeAdditionalValue("key1");

Step 4: Set the metadata object to the job's config

//Instantiate the SIDConfig builder and set the metadata
SIDConfig.Builder sidConfig = new SIDConfig.Builder(this)
.....
.setSIDMetadata(metadata)
.....
.build(tag);

Step 5: Submit the job

//Instantiate SIDNetworkRequest object to send
SIDNetworkRequest mSINetworkrequest = new SIDNetworkRequest(this);
...
...
...
//submit the job
mSINetworkrequest.submit(sidConfig);

Tags

A tag defines a name for a container, where selfies, ID card and other data will be saved on your phone. The tag and associated container can be accessed at any time as long as it's not deleted by the user or the content of the container referenced by the tag is not yet uploaded to the server. It is important to note that tags should be used to identify a unique job. Reuse of a single tag for multiple jobs will cause you to lose data and may have negative side effects.

Tags are set during Selfie capture, ID card capture, and when building submit Configuration.

During selfie capture, when calling captureSelfie method. If the container referenced by the tag already has existing selfies, they will be updated.

During ID card capture, the tag is set in the constructor, if an ID card already exists in the container referenced by the tag, it will be updated

When building submit configuration, the tag is set in SIDConfig build method. This will tell the SDK the container you want to upload to the server. Building the config saves or updates the state of the defined Job in memory. It's kept in memory until the user deletes the tag, or selfies have been successfully uploaded to the server. On successful upload, the library deletes the tag and associated container from memory.

Deleting a tag sidConfig.removeTag(String tag); returns a boolean if the removal is successful

Return all saved tags sidConfig.getTags(); results returns as set

Deleting all tags will remove all tags and associated data, cannot be reversed

Setting the Job Type

The job type is set in the SIDConfig builderExample:Build an SIDConfig for Authentication with 258 jobType to force rejection if a possible spoof is detectedThen call the SIDNetworkRequest submit method to upload to server : SIDNetworkRequest.submit(config Find more on job types here

Geolocation Data

The geolocation info is fetched app side using google awareness api and the result sent to the library. Before starting a selfie capture, call SIDGeoInfos.getInstance().init(Context);

This will initialize and fetch user location.

The geo info requires ACCESS_FINE_LOCATION permission to be granted by the user. Set user location User location is set in the SID Config file.Get Geo Information:

The class SIDGeoInfos contains the logic to fetch the location.

Re-use Enrollment Id's

If you have the enrolled Job Id and User Id you can reuse those values for authentication.

partnerData is the partner data source

thisUser is an index into partnerData that points to the user being enrolled or authenticated

Re-enroll a User

The SmartSelfie™ demo has 2 buttons to demonstrate re-enroll.

To re-enroll a user, set the enroll User ID in PartnerParams before submitting SIDConfig object.

1) Get a PartnerParams instance and set the enroll User Id

2) Build SIDConfig after setting the enroll User Id

3) Submit configuration

Camera Preview

You are able to customize the CameraSourcePreview.

The CameraSourcePreview custom view used to facilitate selfie capture can be customize with 5 attributes:

Job Type

Meaning

capturing_progress_state_color (color)

defines the color of the progress circle when the library is capturing the selfie

captured_progress_state_color (color)

defines the color of the progress circle when the library captured a selfie also when the capture is complete.

progress_width (dimension)

Width of the capture progress circle

overlay_width (dimension)

Width of the oval guide of the face capture

overlay_height (dimension)

height of the oval guide of the face capture

This will result with a circular selfie oval guide of the face capture with black and white colors for capture and capturing progress state

Accessing your Results

Once you’ve completed a job, you’ll received your results. Do view these results and the details around them, please login to your portal.

1. Visit the following URL: https://smileid.herokuapp.com/

Login using your unique partner credentials and you will be taken to your partner portal

2. Click the “Live Results” option to be taken to a list of your most recent jobs.

3. From here, you will be able to identify your job using your Job ID. You can get your Job ID from the `onEnrolled` or `onAuthenticated` methods in your Android app or from the Callback to your server.

If the Job can’t be found, you can search using the Job ID from the app

Reviews

To authenticate requests provide a signature and timestamp as documented in the API Access section of the documentation.

To request review images, make a get request with the String value of your partner_id, and the job_id (string). The partner_id can be found in the documentation section, and the job_id is provided in both the return from a call to job_status, and the body of the callback sent to your server. You'll notice in the documentation there are two versions of partner_id, a String version and an Integer version. The String version is a 3 digit string for example partner_id 1 has a String Value "001". Also note that the job_id we are talking about here is not the Smile ID job id we set, it is the job id generated by your system when creating the ID Validation request (uuid).

The review_id in the url is the id returned in the request to obtain the review images. The email field should correspond to the email of a Smile Identity account associated with your company.

For a update_image review, the only judgement required is whether to accept the photo or not. Therefore the review portion only requires the ‘accept’ field to be filled with a boolean indicating whether or not to accept the new image.

The user api is capable of changing the state of your enrolled users in 3 ways. The first is to allow re-enrollment. Setting allow_re_enroll to true will allow your user to update their selfie and other information on file. Setting it to false would prevent that ability. The second is to toggle the active status of a user. Setting active to true would allow your user to perform actions such as authenticate, and is the default status once a user has been enrolled. While in a de-activated state, your user would be unable to perform actions using Smile Identity, such as perform an authentication. The third is to delete a user from the smile identity system. Deletion cannot be undone. The api will allow you to toggle the values for re-enrollment and active status.