Skip to main content

Trust Bioidentity v3

Bioidentity v3 is an SDK responsible for providing identity validation through a photograph of a person's fingerprint using the camera of a mobile device

Table of content

Implementation

To enable the retrieval of Trust Technologies hosted packages via Gradle, the first step is to add your repository to the build.gradle file (project level).

To do add the following, at any location, to your build.gradle file:

  repositories {  
maven { url" https://dl.cloudsmith.io/q5Eobaq15KV0Rlk3/trusttechnologies/bioidentityv3/maven/" }
}

After the repository is added to the build.gradle file, all that is left is to specify the dependency in the dependencies section of the project build.gradle file (app level).

To do this add the below to your build.gradle file (app level):

dependencies {    
implementation 'com.trust.bioidentity:Bioidentity:1.0.1'
}

See the actual version here.

Permissions

For the correct use of the SDK camera permissions are needed.

<uses-permission android:name="android.permission.CAMERA" />

Methods

Builder

NameDescriptionDefault ValueOptional
contextSpecifies the context-No
ninDNI of the user-No
countrySpecifies the countryCHLNo
index---
strategyTypeSpecifies the fingerFINGERNo
companyIdSpecifies the id of the company-No
providerSpecifies the provider companyTRUSTNo
clientIdSpecifies the client Id-No
clientSecretSpecifies the client secret-No
transactionIdSpecifies the transaction IdnullYes

Example Builder

val trust = Bioidentity.Builder()  
.withContext(this)
.withCompanyId(1)
.withIndex(2)
.withClientId(<YOUR_CLIENT_ID>)
.withClientSecret(<YOUR_CLIENT_SECRET>)
.withProvider(Provider.TRUST)
.withCountry(Country.CHL)
.withStrategyType(Strategy.FINGER)
.build()

Init

Bioidentity.init(context)

Request validation

trust.requestValidation()

Request enrol

trust.requestEnrol()

Handle response

TrustBioidentify.handleResponse(resultCode: Int, data: Intent?): TrustBioidentifyResponse

Responses

ResponseDescription
RESULT_CANCELEDThe user has canceled the process
RESULT_FIRST_USERService error has occurred
RESULT_OKValidation was successful
RESULT_REJECTEDValidation was rejected

Errors

Possible errors that can be found when integrating the SDK

CodeValue
0Unknow error
400Bad request
401The request was unauthorized
403The request was forbidden
404The requested could not be found
405Method not allowed
500Internal server error
501Not implemented
502Bad gateway
503Service unavailable
2000Error code bioidentity response
2003Unsupported code bioidentity response
9000Server error

Logs

The logs can only be seen in the debug environment and through the TAG "PRETTY_LOGGER"

to see the logs of the calls to the server, they can be seen through the TAG OkHttpClient

Log example

┌──────────────────────────────────────────────────────────────────────────────────
│ Thread: main
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ ErrorManagerKt.objectToJsonError (ErrorManager.kt:122)
│ TrustLog.e (TrustLog.kt:16)
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
{"errorCode":1000,"errorMessage":"ID must not be null or empty","stackTrace":[]}
└──────────────────────────────────────────────────────────────────────────────────