Create a new detect liveness session.

A session is best for client device scenarios where developers want to authorize a client device to perform only a liveness detection without granting full access to their resource. Created sessions have a limited life span and only authorize clients to perform the desired action before access is expired.

Permissions includes...

    • A token lifetime of 10 minutes.

[!NOTE] Client access can be revoked by deleting the session using the Delete Liveness Session operation. To retrieve a result, use the Get Liveness Session. To audit the individual requests that a client has made to your resource, use the List Liveness Session Audit Entries.

post/detectLiveness/singleModal/sessions

Request body

livenessOperationMode'Passive' | 'PassiveActive' required

The liveness operation mode to drive the client's end-user experience.

sendResultsToClientboolean

Whether or not to allow a '200 - Success' response body to be sent to the client, which may be undesirable for security reasons. Default is false, clients will receive a '204 - NoContent' empty body response. Regardless of selection, calling Session GetResult will always contain a response body enabling business logic to be implemented.

deviceCorrelationIdSetInClientboolean

Whether or not to allow client to set their own 'deviceCorrelationId' via the Vision SDK. Default is false, and 'deviceCorrelationId' must be set in this request body.

enableSessionImageboolean

Whether or not store the session image.

livenessSingleModalModel'2022-10-15-preview.04' | '2023-12-20-preview.06'

The model version used for liveness classification.

deviceCorrelationIdstring

Unique Guid per each end-user device. This is to provide rate limiting and anti-hammering. If 'deviceCorrelationIdSetInClient' is true in this request, this 'deviceCorrelationId' must be null.

authTokenTimeToLiveInSecondsinteger

Seconds the session should last for. Range is 60 to 86400 seconds. Default value is 600.

Response

A successful call create a session for a client device and provide an authorization token for use by the client application for a limited purpose and time.

sessionIdstring required

The unique session ID of the created session. It will expire 48 hours after it was created or may be deleted sooner using the corresponding Session DELETE operation.

authTokenstring required

Bearer token to provide authentication for the Vision SDK running on a client application. This Bearer token has limited permissions to perform only the required action and expires after the TTL time. It is also auditable.

Changes