Face Session Flow
Note: This feature requires an additional permission and must be explicitly requested
This feature can be used to initiate a facial recognition session based on an image (e.g. id photo) provided through our API (see "Face Session API" in the API documentation). Below you can find an example to initiate the face session.
The following method should be called when the application is initiated:
You require an authorisation token from the Uqudo API using the credentials for your account.
Configuration options
The configuration options are described below:
Property | Type | Optional | Default | Description |
---|---|---|---|---|
setToken(token) | String | No | null | See Authorisation |
setSessionId(id) | String | No | null | The session id returned by the “Face Session API”, see API documentation |
setNonce(nonce) | String | Yes | null | Nonce provided by the customer mobile application when the SDK is initiated. It is useful to make sure the process has been initiated by the customer mobile application. It should be generated server side. |
disableSecureWindow() | None | Yes | false | Whether to allow users to take screenshots and capture screen recording or not. |
setMinimumMatchLevel(matchLevel) | Int | Yes | None | Defines the minimum match level that the facial recognition has to meet. |
enableAuditTrailImageObfuscation(obfuscationType) | ObfuscationType | Yes | None | Enables audit trail image background obfuscation leaving only the face visible. It can be used when there are privacy concerns related to the background of the selfie taken by the user and shared in the SDK result. There are two types of obfuscations:
|
setMaxAttempts(maxAttempts) | Int | Yes | 3 | Set the max failed facial recognition attempts before dropping the session. Note: only values between 1 and 3 are taken into consideration. |
returnDataForIncompleteSession() | None | Yes | false | When enabled, if the user or the SDK drops the session before completion and there was at least one failed facial recognition attempt, the SDK will return the partial data together with the SessionStatus object in the data attribute, that will contain the same JWS string that is returned in a successful scenario |
Handling the Result
The face session result will be available to the application in the calling Activity’s onActivityResult method:
If the resultCode is equals to Activity.RESULT_OK you can find the SDK result in the data attribute. The string is the JWS, see "SDK result (Face Object)" for details.
If the resultCode is equals to Activity.RESULT_CANCELED you can find the SessionStatus object result in the data attribute under the key “key_session_status”. The SessionStatus contains the following properties:
sessionStatusCode as SessionStatusCode enum that contains the following error codes:
USER_CANCELLED = User canceled the enrollment process
SESSION_EXPIRED = Session expired or not found
UNEXPECTED_ERROR = Something went wrong. In the message the details of the error
SESSION_INVALIDATED_FACE_RECOGNITION_TOO_MANY_ATTEMPTS = Session gets invalidated because of too many failed facial recognition attempts
sessionTask as SessionTask enum that contains the following codes:
SCAN = The scanning task
READING = The NFC reading task
FACE = The facial recognition task
BACKGROUND_CHECK = The background check task
data as String that contains the JWS object with the partial data of an incomplete KYC session. Returning the partial data for an incomplete KYC session is disabled by default, please see the configuration options available.
Last updated