Connecting SDK to API
To connect SDK to Oz API, specify the API URL, access token, and SSL pins as shown below.
OzLivenessSDK.setApiConnection(OzConnection.fromServiceToken(host, token, sslPins))OzLivenessSDK.INSTANCE.setApiConnection(
OzConnection.Companion.fromServiceToken(host, token, sslPins),
null
);Alternatively, you can use the login and password provided by your Oz Forensics account manager:
OzLivenessSDK.setApiConnection(
OzConnection.fromCredentials(host, username, password, sslPins),
statusListener(
{ token -> /* token */ },
{ ex -> /* error */ }
)
)OzLivenessSDK.INSTANCE.setApiConnection(
OzConnection.Companion.fromCredentials(host, username, password, sslPins),
new StatusListener<String>() {
@Override
public void onStatusChanged(@Nullable String s) {}
@Override
public void onSuccess(String token) { /* token */ }
@Override
public void onError(@NonNull OzException e) { /* error */ }
}
);Although, the preferred option is authentication via access token – for security reasons.
By default, logs are saved along with the analyses' data. If you need to keep the logs distinct from the analysis data, set up the separate connection for telemetry as shown below:
OzLivenessSDK.setEventsConnection(
OzConnection.fromCredentials(
"https://echo.cdn.ozforensics.com/",
"<your_telemetry_user_eg_tm@company.com>",
"your_telemetry_password"
)
)OzLivenessSDK.setEventsConnection(
OzConnection.fromCredentials(
"https://tm.ozforensics.com/",
"<your_telemetry_user_eg_tm@company.com>",
"your_telemetry_password"
)
);Clearing authorization:
Other methods
Check for the presence of the saved Oz API access token:
LogOut:
Last updated
Was this helpful?
