Ping One Mobile Confirmation Callback
A callback interface for receiving the result of a mobile push authentication approval.
Implementations of this interface are notified when the user has approved/denied a push authentication request using approve.
When the process completes, the confirmationInfo parameter will contain public information about the confirmed authentication. This JSON may include the deviceRequirementsEvaluation object, which contains the result of the server-side device requirements evaluation, including its status, an optional failure reason, and an optional device requirements data hash. If the process fails, the error parameter will provide details about the failure.
Example usage:
notificationObject.approve(context, "fpt", null, new PingOneMobileConfirmationCallback() {
public void onComplete(@Nullable JsonObject confirmationInfo, @Nullable PingOneSDKError error) {
if (error == null) {
Log.d("PingOne", "Push approval succeeded: " + confirmationInfo.toString());
JsonObject deviceRequirementsEvaluation =
confirmationInfo != null
? confirmationInfo.getAsJsonObject("deviceRequirementsEvaluation")
: null;
if (deviceRequirementsEvaluation != null) {
Log.d("PingOne", "Device requirements evaluation status: "
+ deviceRequirementsEvaluation.get("status").getAsString());
}
} else {
Log.e("PingOne", "Push approval failed: " + error.getMessage());
}
}
});
This interface extends PingOneSDKCallback, which provides a simpler completion method. By default, onComplete is a no-op; use onComplete for detailed results.
Example confirmationInfo when device requirements evaluation fails:
{
"deviceRequirementsEvaluation": {
"status": "Failed",
"reason": "deviceBrandsDisAllowed",
"deviceRequirementsDataHash": "tK3pi0+/RSd0m7O3S0Q+IpOYu+Q/kOE5sLVFx9rAAXk="
}
}
Example confirmationInfo when device requirements evaluation passes:
{
"deviceRequirementsEvaluation": {
"status": "Passed",
"reason": null,
"deviceRequirementsDataHash": "tK3pi0+/RSd0m7O3S0Q+IpOYu+Q/kOE5sLVFx9rAAXk="
}
}
The deviceRequirementsEvaluation object, when present inside confirmationInfo, corresponds to com.pingidentity.pingidsdkv2.communication.models.DeviceRequirementsEvaluation.