Skip to main content

Silent Revalidation

PrepareInfo attributes
AttributeTypeRequiredDescription
externalUserIdStringUser identifier in your system. Automatically hashed with SHA-256 before transmission, never sent in plain text.
Starting a Silent Revalidation
Step 1 — Implement initializeSDK

Create a new UnicoSDK class/object, with a static initializeSDK method that returns the UnicoSDK instance, receiving the context and a UnicoSDKConfig with your sdkKey, bundleId, and environment. Keep the returned instance — it is needed later to call startSilentValidation from Java.

Call it on app launch

UnicoSDK.initializeSDK must be called as early as possible on app launch (e.g., Application.onCreate). Calling it later reduces background processing time and increases the chance of inconclusive authentication responses.

UnicoSDK.initializeSDK(
context,
UnicoSDKConfig(
sdkKey = "your_sdk_key",
bundleId = "your_bundle_id",
environment = Environment.UAT
)
)
Step 2 — Implement startSilentValidation

After initializeSDK, associate the collection already in progress with the identified user by calling startSilentValidation with a PrepareInfo containing the externalUserId.

val prepareInfo = PrepareInfo(
externalUserId = "external_user_id"
)

UnicoSDK.startSilentValidation(prepareInfo)
.onSuccess { result -> /* ... */ }
.onFailure { error -> /* ... */ }

If the validation happens at the start of the flow, for example at login, wait for the onSuccess callback before moving on to Step 3.

Step 3 — Create the process and authenticate

With validation in progress, create the verification process to complete the authentication. See API Reference ▸ API ▸ Create Process.

Include the same externalUserId sent in the PrepareInfo from Step 2 in the request body — this is what allows the backend to correlate the process creation with the validation already in progress.

curl -X POST https://api.id.unico.app/processes/v1 \
-H "Authorization: Bearer $TOKEN" \
-H "APIKEY: $API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": {
"duiType": 1,
"code": "12345678909",
"name": "Luke Skywalker",
"gender": "M",
"birthDate": "2000-05-20",
"email": "[email protected]",
"phone": "5519725570707"
},
"useCase": "Onboarding",
"externalUserId": "external_user_id",
"imageBase64": "/9j/4AAQSkZJR..."
}'

The response includes the silentAuth.result field with the authentication result:

{
"id": "80371b2a-3ac7-432e-866d-57fe37896ac6",
"status": 3,
"silentAuth": {
"result": "yes"
}
}
FieldTypeDescription
silentAuth.resultstringyes or no — see possible values below.
silentAuth.result — possible values
ValueMeaning
yesAuthentication approved, user recognized with sufficient confidence, no additional capture needed.
noInsufficient data to approve silently. Authenticating via biometrics (selfie) or another alternative method is recommended.