Updated on 2026-07-22 GMT+08:00

Querying the Account Login Policy

Function

This API is used to query the account login policy.

Authorization Information

Each account root user has all the permissions required to call all APIs, but IAM users must be assigned the following required identity policy-based permissions. For details about the required permissions, see Permissions Policies and Supported Actions.

Action

Access Level

Resource Type (*: required)

Condition Key

Alias

Dependencies

iam:securitypolicies:getLoginPolicyV5

Read

-

-

-

-

URI

GET /v5/login-policy

Request Parameters

None

Response Parameters

Status code: 200

Table 1 Response body parameters

Parameter

Type

Description

login_policy

login_policy object

Definition:

Login authentication policy

Range:

N/A

Table 2 login_policy

Parameter

Type

Description

user_validity_period

Integer

Definition:

If an IAM user does not log in within the validity period (days) specified by this parameter, the user will be disabled.

Range:

N/A

custom_info_for_login

String

Definition:

Login information.

Range:

N/A

lockout_duration

Integer

Definition:

Account lockout duration (minute) for IAM users.

Range:

N/A

login_failed_times

Integer

Definition:

Maximum number of invalid login attempts.

Range:

N/A

period_with_login_failures

Integer

Definition:

Time limit (minutes).

Range:

N/A

session_timeout

Integer

Definition:

Login session expiration time.

Range:

N/A

show_recent_login_info

Boolean

Definition:

Whether to display the latest login information.

Range:

N/A

allow_address_netmasks

Array of allow_address_netmasks objects

Definition:

IP address or network segment that can be accessed.

Range:

N/A

allow_ip_ranges

Array of allow_ip_ranges objects

Definition:

IP address range from which access is allowed.

Range:

N/A

Table 3 allow_address_netmasks

Parameter

Type

Description

address_netmask

String

Definition:

IP address or CIDR block, for example, 192.168.0.1/24.

Range:

N/A

description

String

Definition:

Description.

Range:

N/A

Table 4 allow_ip_ranges

Parameter

Type

Description

ip_range

String

Definition:

IP address range, for example, 0.0.0.0-255.255.255.255.

Range:

N/A

description

String

Definition:

Description.

Range:

N/A

Status code: 403

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Definition :

Error code. For details, see Error Code.

Range:

The format is PAP5.XXXX, for example, PAP5.0012.

error_msg

String

Definition :

Error message. For details, see Error Message.

Range:

N/A.

request_id

String

Definition:

Unique identifier of an API request, which is used to locate API calling exceptions.

Range:

N/A

encoded_authorization_message

String

Definition :

Encrypted details returned when the authentication fails, which are used to locate authentication problems. The STS5 decryption API can be used for decryption. For details, see API link.

Range:

N/A.

Example Requests

Querying the account login policy

GET https://{endpoint}/v5/login-policy

Example Responses

Status code: 200

Successful

{
  "login_policy" : {
    "user_validity_period" : 0,
    "custom_info_for_login" : "info",
    "lockout_duration" : 15,
    "login_failed_times" : 5,
    "period_with_login_failures" : 15,
    "session_timeout" : 60,
    "show_recent_login_info" : false,
    "allow_sms_login" : true,
    "allow_address_netmasks" : [ {
      "address_netmask" : "192.168.0.1/24",
      "description" : "description"
    } ],
    "allow_ip_ranges" : [ {
      "ip_range" : "0.0.0.0-255.255.255.255",
      "description" : "description"
    } ]
  }
}

Status Codes

Status Code

Description

200

Successful

403

Forbidden

Error Codes

See Error Codes.