Validate User Password

PUT/zstack/v1/password/verify

Body

{
  "validatePassword": {
    "loginName": "test",
    "password": "password",
    "loginType": "account"
  },
  "systemTags": [],
  "userTags": []
}

The systemTags and userTags fields in the above example are optional. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-X PUT -d '{"validatePassword":{"loginName":"test","password":"password","loginType":"account"}}' \
http://localhost:8080/zstack/v1/password/verify

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
loginNameStringbody (contained in the validatePassword structure)Username 4.0.0
passwordStringbody (contained in the validatePassword structure)User password 4.0.0
loginTypeStringbody (contained in the validatePassword structure)Login type 4.0.0
systemTags (optional)ListbodySystem tags 4.0.0
userTags (optional)ListbodyUser tags 4.0.0

API Response

Response Example

{
  "available": true
}
NameTypeDescriptionStarting Version
availablebooleanWhether the operation is allowed4.0.0
successboolean 4.0.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. See error4.0.0

error

NameTypeDescriptionStarting Version
codeStringError code number. A globally unique identifier for the error, e.g., SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeRoot error. The source error that caused this error. Null if no root cause exists0.6

SDK Examples

Java SDK

ValidatePasswordAction action = new ValidatePasswordAction();
action.loginName = "test";
action.password = "password";
action.loginType = "account";
ValidatePasswordAction.Result res = action.call();

Python SDK

ValidatePasswordAction action = ValidatePasswordAction()
action.loginName = "test"
action.password = "password"
action.loginType = "account"
ValidatePasswordAction.Result res = action.call()