verifyAuthentication
POST /ams/api/v1/security/verifyAuthentication
Use this API to verify authentication. When the merchant performs verification initialization and triggers a challenge, call this API to verify the challenge.
Structure
A message consists of a header and body. The following sections are focused on the body structure. For the header structure, see:
Note: Set the data type of each field (except array) as String. This means that you must use double quotation marks (" ") to enclose the field value. Examples:
- If the data type of a field is Integer and its value is 20, set it as "20".
- If the data type of a field is Boolean and its value is
true
, set it as "true".
Request parameters
Field | Data type | Required | Description | Examples |
authenticationRequestId | String | Yes | After the verification initialization, DWS returns authenticationId. The value of authenticationRequestId must be the same during the whole authentication process. More information about this field:
| "54635453532638728382372" |
authenticationMethod | String | No | The authentication method. This field indicates the method by which the user's identity is verified. Valid values are:
More information about this field:
| "OTP" |
authenticationType | String | No | The concrete type of authentication method that is used to authenticate the user. Valid values are:
More information about this field:
| "SMS" |
authenticationId | String | Yes | The authentication ID throughout the process. Returned when the verification is initialized. More information about this field:
| "20220105190077000000162140200586657" |
challengeData | No | The data returned when challenged after risk consultation. See ChallengeData for details. | { "challengeType":"PAYMENT_PASSWORD", "passwordValue":"y+ySfvHVzoIXJw3bKckgtHdMXknQ4lt1A9hR8Jg/WIrAUyYA0g5obCdvY/S50wbb2A5fOfWEK+E/8iGbDjOaxpa62UbwKh1VUIqBhVFGesBTOfn/B7lb3+F9HtWU3SaeSodcXWKH0IZJvYgMSDrzit29vsW67NQOX1aAvtWHVwRbP0Rx015lH/L2uTfqBm6pwqR1muGCxy9VnjgTjtpKrDw2Y/abIt5iEYBFA+iZro4v4r+9RC092BLX4mIUZbebI0Q2WblvzGCiMRDLSlZShmnPCzJXTZ674A/zpvh+kjouFL3Lekcgos6l6KUzw9VupyWkSXJyRKU1JTs+zI67A==" } | |
env | No | The environment information, and data collection for transaction risk. See Env for details. | { "appVersion": "6.84.2", "clientIp": "175.***.**.***", "deviceModel": "TECNO LD7", "deviceTokenId": "wiQ5Hlwx3QLMkRS3R3OMtOAnznRWKJ6lFPgs7GDgihiuimC9fQEAAA==", "language": "en-PH", "operateEntrance": "DWS", "osType": "Android", "osVersion": "10", "sessionId": "1e32d8b642590af5c3cba8ad5d111c2c", "terminalType": "APP", "umidTokenId": "DYQAEhpLPO4XcQN9vXk/RHl6C7oLX+41" } |
Response parameters
Field | Data type | Required | Description | Examples |
result | Yes | The result contains information such as status and error codes. | { "resultCode":"SUCCESS", "resultMessage":"success.", "resultStatus":"S" } | |
pass | String | No | Whether this verification is passed. Valid values are:
| "TRUE" |
authenticationRequestId | String | No | The unique ID that is assigned by a merchant to identify an authentication process. More information about this field:
| "5678909876567890987656789" |
totalErrorTimes | String | No | The number of times an OTP value or payment password was sequentially entered incorrectly. More information about this field:
Note: This field is returned when result.resultStatus is | "3" |
remainTryTimes | String | No | The number of remaining tries for verification. More information about this field:
Note: This field is returned when result.resultStatus is | "3" |
lastErrorTime | Datetime | No | The last time that an incorrect value was entered. The value follows the ISO 8601 standard format. Note: This field is returned when result.resultStatus is | "2019-11-27T12:01:01+08:30" |
actionForm | Map<String, Object> | No | The next action to do when the processing result is not the final status, as a reference for the next action. According to challengeType, you can determine the factor to be verified in the next step. |
Result processing logic
In the response, the result.resultStatus field indicates the result of the verifyAuthentication request. The following table describes each result status:
Result status | Description |
S | The verifyAuthentication request is accepted successfully. The corresponding result.resultCode is
|
U | The status of the verifyAuthentication request is unknown. The corresponding result.resultCode is |
F | The verifyAuthentication request failed. The corresponding result.resultCode and result.resultMessage may vary based on different situations. For details, see the following Error codes section. |
Error codes
Result code | Result status | Result message | Further action |
SUCCESS | S | Success | N/A |
REPEAT_REQ_INCONSISTENT | F | Repeated requests are inconsistent. | Ensure the fields in the requests are the same. |
PARAM_ILLEGAL | F | Illegal parameters exist. For example, a non-numeric input, or an invalid date. | Check and verify whether the request fields, including the header fields and body fields, are correct and valid. For details on the fields of each API, see the specific API Structure section. |
PROCESS_FAIL | F | A general business failure occurred. Don't retry. | Human intervention is usually needed. It is recommended that you contact the technical support team to troubleshoot the issue. |
UNKNOWN_EXCEPTION | U | An API call is failed, which is caused by unknown reasons. | Call the interface again to resolve the issue. If the issue persists, contact Alipay Technical Support. |
VERIFICATION_ORDER_NOT_EXIST | F | The verification order does not exist. | Check whether authenticationRequestId is the same as authenticationId returned by DWS. |
SECURITY_VERIFY_FAILURE |