Modifying Information About a User

Function

Currently, only the password of a specified user can be changed.

Syntax

Operation type: PATCH

URL: https://device_ip/redfish/v1/AccountService/Accounts/<member_id>

Request header:

X-Auth-Token: auth_value
Content-Type: application/json

Request message body:

{
    "UserName": "admin",
    "old_password": "old_password",
    "Password":"new_password",
    "new_password_second": "new_password_second"
}

URL Parameters

Table 1 URL parameters

Parameter

Mandatory/Optional

Parameter Description

Value

<member_id>

Mandatory

ID of the user to be queried.

User ID. The value is a string of 1 to 16 digits.

Request Parameters

Table 2 Request parameters

Parameter

Mandatory/Optional

Parameter Description

Value

UserName

Mandatory

Name of the user whose password needs to be changed.

The value is a string of 1 to 16 characters, which can contain digits and letters but cannot contain only digits.

old_password

Mandatory

Password to be changed.

A string of 8 to 20 characters. The password complexity check is enabled by default. The password must meet password complexity requirements.

Password

Mandatory

New password.

A string of 8 to 20 characters. The password complexity check is enabled by default. The password must meet password complexity requirements.

new_password_second

Mandatory

New password to be confirmed.

A string of 8 to 20 characters. The password complexity check is enabled by default. The password must meet password complexity requirements.

Usage Guidelines

For a specified user, only the password attribute in the request message body can be modified.

Example

Request:

PATCH https://10.10.10.10/redfish/v1/AccountService/Accounts/1

Request header:

X-Auth-Token: auth_value
Content-Type: application/json

Request message body:

{
    "UserName": "test",
    "old_password": "old_password",
    "Password":"password",
    "new_password_second":"password"
}

Response:

{
    "@odata.context": "/redfish/v1/$metadata#AccountService/Accounts/Members/$entity",
    "@odata.id": "/redfish/v1/AccountService/Accounts/1",
    "@odata.type": "#ManagerAccount.v1_3_4.ManagerAccount",
    "Id": "1",
    "Name": "User Account",
    "Oem": {
        "LastLoginSuccessTime": "2022-11-16 20:54:03",
        "LastLoginFailureTime": "2022-11-16 06:15:29",
        "AccountInsecurePrompt": false,
        "ConfigNavigatorPrompt": true,
        "PasswordValidDays": "--",
        "PwordWrongTimes": 0,
        "LastLoginIP": "127.0.xx.xx"
    }
}

Response code: 200

Output Description

Table 3 Operation output description

Field

Type

Description

@odata.context

Character string

OData description of a user resource model.

@odata.id

Character string

Path to access a user resource.

@odata.type

Character string

User resource type.

Id

Character string

User resource ID.

Name

Character string

User resource name.

Oem

Object

Custom attribute.

LastLoginSuccessTime

Character string

Time of the last successful login.

If this parameter is empty, the user logs in to the system for the first time.

LastLoginFailureTime

Character string

Time of the last login failure.

If this parameter is empty, no failure occurs.

AccountInsecurePrompt

Boolean

Insecure password prompt.
  • true: The password is the default.
  • false: The password is not the default.

ConfigNavigatorPrompt

Boolean

Whether to remind a user to enter the quick configuration wizard. The default value is true. When the browser completes the configuration wizard, change the value of this attribute to false.

PasswordValidDays

Character string

The value is a number, indicating the remaining days of the password validity period.

-- indicates that the validity period is unlimited.

PwordWrongTimes

Number

Number of login failures before a successful login.

The value can be 0, 1, 2, 3, 4, or 5.

LastLoginIP

Character string

IP address of last login.