一、支持的应用类型
Web 应用、单页应用、移动 App、M2M 应用、小程序应用。
二、请求方法
POST
三、请求路径
/change_user_password
四、请求 Content-Type
application/json
五、请求示例
POST /change_user_password HTTP/1.1Content-Type: application/jsonAuthorization: Bearer ACCESS_TOKEN_WITH_OPENID_SCOPEHost: sample.portal.tencentciam.com{ "old_password" : "MOCK_PASSWORD", "new_password" : "MOCK_NEW_PASSWORD"}
六、请求头
| 名称 | 描述 |
| Authorization | OAuth 2.0 Bearer Token,格式为 Bearer <Token>,其中 Bearer 为固定字符串,<Token> 为用户登录成功时得到的具备 openid scope 的 Access Token,Bearer 和 <Token> 之间用一个空格隔开。 |
七、请求体 JSON 参数
| JSON 路径 | 数据类型 | 描述 |
| old_password | String | 旧密码。 |
| new_password | String | 新密码。 |
八、正常响应示例
HTTP/1.1 200 OK
九、异常响应示例
·旧密码错误。
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "wrong_old_password"}
·新密码与旧密码相同。
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "duplicate_password"}
·新密码与历史密码相同。
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "recurrent_password"}
·新密码不满足密码策略。
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "invalid_new_password"}
·用户未找到。
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "user_not_found"}
·用户被冻结。
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "abnormal_user_status","error_description" : "User is frozen."}
·用户被锁定。
HTTP/1.1 400 Bad RequestContent-Type: application/json;charset=UTF-8{"error" : "abnormal_user_status","error_description" : "User is locked."}
·bearer_token 缺失。
HTTP/1.1 400 Bad RequestWWW-Authenticate: Bearer error="invalid_request", error_description="Bearer token not found in the request", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
·bearer_token 错误。
HTTP/1.1 401 UnauthorizedWWW-Authenticate: Bearer error="invalid_token", error_description="Error decoding JWT", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
·bearer_token 无效。
HTTP/1.1 403 ForbiddenWWW-Authenticate: Bearer error="insufficient_scope", error_description="The request requires higher priv