Customer Identity (CIAM)
Change Personal Password Using Current Password
There are three methods to change a personal password:
Change Password via Mobile Number
Change Password via Email
Change Password Using Current Password
This article primarily describes changing a personal password using the current password.
After a user successfully logs in, first call the [Check If Personal Password Is Set API], then call this interface. If a password is already set, the current password must be passed in the parameters. If no password is set, only the new password needs to be passed.
This is a post-login interface. The Authorization information must be added to the header: Authorization
# Request Description
POST https://{your_domain}/api/v2/sdk/pwd/change
# Request Headers
| Parameter Name | Chinese Name | Required | Type | Example |
|---|---|---|---|---|
| X-operating-sys-version | Calling Client OS Version | Yes | String | windows10.1.1 |
| X-device-fingerprint | Calling Client Device Fingerprint | Yes | String | 156aysdna213sc50 |
| X-device-ip | Calling Client IP | No | String | 192.168.1.2 |
| X-agent | User-Agent Information | Yes | String | Mozilla/5.0 (iPhone; CPU iPhone OS 13_3 like Mac OS X) |
| X-L | For Internationalization Language Setting | No | String | zh |
| X-client-id | Application Authorization ID | Yes | String | nTo1eRIub60vPb54WeE6aojPwYwImtl4 |
| Authorization | Authorization Information | Yes | String | Bearer {id_token} |
| content-type | Content Format Type | Yes | String | application/json |
# Request Example
{
"old_password": "aaaaaa",
"new_password": "bbbbbb"
}
1
2
3
4
2
3
4
# Request Parameters
| Parameter Name | Chinese Name | Required | Type | Description |
|---|---|---|---|---|
| old_password | Original Password | No | String | The user's old password. Can be omitted if the user has not set an old password before. |
| new_password | New Password | Yes | String | The new password to be set. |
# Response Example
Success Example:
HTTP/1.1 200 OK
Content-Type: application/json
Error Example:
HTTP/1.1 400 Bad Request
{
"error_code": "IDAAS.SDK.PARAM.0016",
"error_msg": "IdToken is invalid or expired"
}
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
# Response Parameters
None
# Error Codes
| Status Code | Error Code | Error Message | Handling Measures |
|---|---|---|---|
| 400 | IDAAS.SDK.PARAM.0001 | Device information is incomplete | Please check if the input device information is complete. |
| 设备信息不完整 | |||
| 400 | IDAAS.SDK.PARAM.0002 | clientId cannot be empty | Please check if the input clientId is empty. |
| clientId不能为空 | |||
| 400 | IDAAS.SDK.PARAM.0003 | The app is not registered, please register the app first | Please check if the input clientId is correct. |
| 应用未注册,请先注册应用 | |||
| 400 | IDAAS.SDK.PARAM.0015 | IdToken cannot be empty | Please check if the input IdToken is empty. |
| IdToken不能为空 | |||
| 400 | IDAAS.SDK.PARAM.0016 | IdToken is invalid or expired | Please try again after obtaining a new IdToken. |
| IdToken无效或已过期 | |||
| 400 | IDAAS.SDK.PARAM.0018 | Original password cannot be empty | Please check if the input original password is empty. |
| 原密码不能为空 | |||
| 400 | IDAAS.SDK.PARAM.0019 | New password cannot be empty | Please check if the input new password is empty. |
| 新密码不能为空 | |||
| 400 | IDAAS.SDK.PARAM.0020 | The original password and the new password do not match | Please check if the input original password and new password are identical. |
| 原密码和新密码不能一致 | |||
| 400 | IDAAS.SDK.PWD.0001 | The password is used before, cannot be used again | Please re-enter the password. |
| 不允许使用历史密码 | |||
| 400 | IDAAS.SDK.PWD.0002 | Password cannot username in reverse order | Please re-enter the password. |
| 密码不允许使用用户名的倒写 | |||
| 400 | IDAAS.SDK.PWD.0003 | Password cannot contain :username, phone number, email prefix, name in PinYing | Please re-enter the password. |
| 密码中不允许包含:用户名、手机号、邮箱前缀、姓名拼音 | |||
| 400 | IDAAS.SDK.PWD.0004 | Your password complexity is low, {0} | Please re-enter the password. |
| 密码复杂度低,{0} | |||
| 400 | IDAAS.SDK.PWD.0005 | The password is weak | Please re-enter the password. |
| 该密码为弱密码 | |||
| 400 | IDAAS.SDK.PWD.0006 | Number of character repeat in password should not exceed {0} | Please re-enter the password. |
| 密码中最大字符重复数不能超过{0} | |||
| 400 | IDAAS.SDK.PWD.0007 | The password must contain {0} to {1} characters | Please re-enter the password. |
| 密码长度为{0}~{1}个字符 |
