Force Change Password When Password Expired
When calling the username/password login API, if the password has expired or is about to expire, and the user chooses to change the password, call this API.
Request Description
Request Headers
| Parameter Name | Name | Required | Type | Example |
|---|---|---|---|---|
| X-operating-sys-version | Caller client operating system version | Yes | String | windows10.1.1 |
| X-device-fingerprint | Caller client device fingerprint | Yes | String | 156aysdna213sc50 |
| X-device-ip | Caller 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 | Used for internationalization language setting | No | String | zh |
| X-client-id | Application authorization ID | Yes | String | nTo1eRIub60vPb54WeE6aojPwYwImtl4 |
| X-state-token | Temporary token | Yes | String | eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWJqZWN0Ijoie1............................ |
| content-type | Content format type | Yes | String | application/json |
Request Example
json
{
"old_password": "aaaaaa",
"new_password": "bbbbbb"
}Request Parameters
| Parameter Name | Name | Required | Type | Description |
|---|---|---|---|---|
| old_password | Original password | Yes | String | The user's old password |
| 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
{
"status": "SUCCESS",
"expire": 43200,
"session_token": "LGTiTNVDFPlpefV3F3Hla7RUFTqInsqa",
"id_token": "eyJ0NiJ9.eyJ1cI6IjIifX0.DeWt4QuZXso"
}
Error example:
HTTP/1.1 400 Bad Request
{
"error_code": "IDAAS.SDK.PARAM.0014",
"error_msg": "Invalid state token"
}Response Parameters
| Parameter Name | Name | Type | Description |
|---|---|---|---|
| status | Return result | String | Possible values are as follows: SUCCESS login successful; ACCESS_DENIED access denied |
| expire | session_token validity period | Number | session_token validity period; within the validity period, session_token can be used to obtain ticket |
| session_token | User session_token | String | User session_token; this token can be used to call IDaaS APIs to obtain sso_ticket, and sso_ticket can be exchanged for user information |
| id_token | Short-term valid interface call token | String | This field is in JWT format and contains user identity information. For details, see Get User Info from id_token. The token validity period defaults to 5 minutes and is configurable. |
Error Codes
| Status Code | Error Code | Chinese Error Message | English Error Message | Resolution |
|---|---|---|---|---|
| 400 | IDAAS.SDK.PARAM.0001 | 设备信息不完整 | Device information is incomplete | Please check whether the input device information is complete |
| 400 | IDAAS.SDK.PARAM.0002 | clientId不能为空 | clientId cannot be empty | Please check whether the input clientId is empty |
| 400 | IDAAS.SDK.PARAM.0003 | 应用未注册,请先注册应用 | The app is not registered, please register the app first | Please check whether the input clientId is correct |
| 400 | IDAAS.SDK.PARAM.0013 | 临时令牌不能为空 | State token cannot be empty | Please check whether the input temporary token is empty |
| 400 | IDAAS.SDK.PARAM.0014 | 临时令牌无效 | Invalid state token | Please check whether the input temporary token is correct |
| 400 | IDAAS.SDK.PARAM.0018 | 原密码不能为空 | Original password cannot be empty | Please check whether the input original password is empty |
| 400 | IDAAS.SDK.PARAM.0019 | 新密码不能为空 | New password cannot be empty | Please check whether the input new password is empty |
| 400 | IDAAS.SDK.PARAM.0020 | 原密码和新密码不能一致 | The original password and the new password do not match | Please check whether the original password and new password are consistent |
| 400 | IDAAS.SDK.LOGIN.0001 | 由于多次登录失败,用户已被锁定。 它将在 {0} 分钟和 {1} 秒内解锁 | User has been locked out due to multiple login failures. It will be unlocked in {0} minutes and {1} seconds | Please try again after unlocking |
| 400 | IDAAS.SDK.LOGIN.0002 | 无效的账号或密码。 剩余次数: | Invalid account or password. Remaining times: | Please check whether the input username or password is correct |
| 400 | IDAAS.SDK.USER.0039 | 用户已被禁用 | User is disabled | Please contact the administrator |
| 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, | Please re-enter the password |
| 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 | Please re-enter the password |
| 400 | IDAAS.SDK.PWD.0007 | 密码长度为{0}~{1}个字符 | The password must contain {0} to {1} characters | Please re-enter the password |