Create device binding (green flow)
Last updated
Was this helpful?
Was this helpful?
String vProvisionedTokenId;
String correlationId;
visaCTFHelper.createBinding(vProvisionTokenId,
correlationId,
new TokenBindingListener() {
......
@Override
public void onDeviceAuthentication(DeviceAuthentication deviceAuthentication) {
// Do user authentication
}
@Override
public void onSuccess() { }
@Override
public void onError(TMGClientException exception) {
// Check error
int errorCode = exception.getErrorCode();
int errorMessage = exception.getMessage();
}
});let vProvisionedTokenID: String = ""
let correlationID: String = ""
// 1. Start create binding
visaCTFHelper.createBinding(forVProvisionedTokenID: vProvisionedTokenID,
correlationID: correlationID,
deviceAuthenticationHandler: { auth in
// 2. faceID
let customMessage = "" // Pass in the custom message. e.g: "Authenticate with Face ID"
auth.startAuthentication(withMessage: customMessage)
}, idvSessionHandler: { session in
// Start idv session (only applicable for yellow flow)
}, completionHandler: { session, error in
// 3. binding successful
if error == nil {
}
// Handle error or retry idv session when there is a failure (not applicable for green flow)
})@Override
public void onDeviceAuthentication(DeviceAuthentication deviceAuthentication) {
FragmentActivity fragmentActivity;
CharSequence title;
CharSequence subTitle;
CharSequence description;
CharSequence negativeButtonText;
// Start user authentication
deviceAuthentication.startAuthentication(fragmentActivity,
title,
subTitle,
description,
negativeButtonText);
}let deviceAuhenticationHandler: ((DeviceAuthentication) -> Void) = {(auth) in
// Start user authentication
let customMessage = "" // Pass in the custom message. e.g: "Authenticate with Face ID"
auth.startAuthentication(withMessage: customMessage)
}@Override
public void onError(TMGClientException exception) {
// Check the error
int errorCode = exception.getErrorCode();
int errorMessage = exception.getMessage();
}let vProvisionedTokenID: String = ""
let correlationID: String = ""
// 1. Start create binding
visaCTFHelper.createBinding(forVProvisionedTokenID: vProvisionedTokenID,
correlationID: correlationID,
deviceAuthenticationHandler: { auth in
// 2. cancel device authentication
auth.cancel()
}, idvSessionHandler: { session in
// Start idv session (only applicable for yellow flow)
}, completionHandler: { session, error in
if error == nil {
}
// 3. Handle the cancel error
})