tencent cloud

Tencent OneID Identity Security

Changing User Password

Download
Focus Mode
Font Size
Last updated: 2026-08-26 15:38:13
AI-Translated

API Description

Change the password for a logged-in user. When calling this API, you must carry the Access Token obtained upon successful login, which must have the openid scope. The new password must comply with the password policy of the account password authentication source associated with the current application and must not be the same as any of the previous N historical passwords specified in the policy.

Supported Application Types

Web applications, single-page applications, mobile apps, and M2M applications.

Request Method

POST

Request path

/change_user_password

Request Content-Type

application/json

Request Example

POST /change_user_password HTTP/1.1
Content-Type: application/json
Authorization: Bearer ACCESS_TOKEN_WITH_OPENID_SCOPE
Host: sample.portal.tencentciam.com

{
"old_password" : "MOCK_PASSWORD",
"new_password" : "MOCK_NEW_PASSWORD"
}

Request header

Term
Description
Authorization
The OAuth 2.0 Bearer Token has the format Bearer <Token>. Here, Bearer is a fixed string, and <Token> is the Access Token obtained upon successful user login, which contains the openid scope. A single space separates Bearer and <Token>.

Request Body JSON Parameters

JSON Path
Data Type
Description
old_password
String
Old password.
new_password
String
New password.

Normal Response Example

HTTP/1.1 200 OK

Exception Response Example

The old password is incorrect.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "wrong_old_password"
}
The new password is the same as the old password.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "duplicate_password"
}
The new password is the same as a historical password.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "recurrent_password"
}
The new password does not meet the password policy.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "invalid_new_password"
}
The user was not found.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "user_not_found"
}
The user is frozen.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "abnormal_user_status",
"error_description" : "User is frozen."
}
The user is locked.
HTTP/1.1 400 Bad Request
Content-Type: application/json;charset=UTF-8

{
"error" : "abnormal_user_status",
"error_description" : "User is locked."
}
The bearer_token is missing.
HTTP/1.1 400 Bad Request
WWW-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"
The bearer_token is incorrect.
HTTP/1.1 401 Unauthorized
WWW-Authenticate: Bearer error="invalid_token", error_description="Error decoding JWT", error_uri="https://tools.ietf.org/html/rfc6750#section-3.1"
The bearer_token is invalid.
HTTP/1.1 403 Forbidden
WWW-Authenticate: Bearer error="insufficient_scope", error_description="The request requires higher priv


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback