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.

You require an authorisation token from the Uqudo API using the credentials for your account.

The example below assumes that you have already initialised the SDK:

Objective-C
UQBuilderController *builderController = [UQBuilderController defaultBuilder];
builderController.delegate = self;
builderController.appViewController = self;
 
UQFaceSessionBuilder *faceSessionBuilder = [[UQFaceSessionBuilder alloc] init];   	 
faceSessionBuilder.appViewController = self;
faceSessionBuilder.authorizationToken = <"Your authorization token">;
faceSessionBuilder.sessionId =  <"Your sessionId">;
faceSessionBuilder.nonce = <"Your nonce">
faceSessionBuilder.minimumMatchLevel = 1;

[builderController setFaceSession:faceSessionBuilder];
[builderController performFaceSession];
Swift
let uqudoBuilder = UQBuilderController.defaultBuilder()
uqudoBuilder.delegate = self
let faceSessionBuilder = UQFaceSessionBuilder()
faceSessionBuilder.appViewController = self
faceSessionBuilder.authorizationToken =  <"Your authorization token">
faceSessionBuilder.sessionId = <"Your session id">
faceSessionBuilder.nonce =  <"Your nonce">
faceSessionBuilder.minimumMatchLevel = 1
uqudoBuilder.setFaceSession(faceSessionBuilder)
uqudoBuilder.performFaceSession()

Configuration options

The configuration options are described below:

Handling the Result

The face session result will be available to the builder delegate if the operation succeeds and you get the result with the following method. See "SDK result (Face Object)" for the details about the JWS string:

- (void)didFaceSessionCompleteWithInfo:(NSString *)info {}

A failure scenario can be handled with the following methods:

- (void)didFaceSessionIncompleteWithStatus:(UQSessionStatus *)status {}

See the details about the UQSessionStatus below.

Session Status Handling

The UQSessionStatus is used to identify the status of the enrollment task. The object contains the following properties:

@property (nonatomic, assign) NSInteger statusCode;
@property (nonatomic, assign) NSInteger statusTask;
@property (nonatomic, strong) NSString *message;
@property (nonatomic, strong) NSString *data;

statusCode contains the following error codes:

  • USER_CANCEL = User cancel the operation

  • 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

statusTask contains the following codes:

  • FACE = The facial recognition task

message contains the details of the status code

data as String that contains the JWS object with the partial data of an incomplete KYC session. Returning the partial data for an incomplete Account Recovery session is disabled by default, please see the "Configuration Options" for details.

Last updated