All Products
Search
Document Center

Resource Access Management:GetSecurityPreference

Last Updated:Mar 12, 2025

Queries the security preferences for RAM users.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ram:GetSecurityPreferenceget
*All Resources
*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
The current API does not require request parameters

For more information about common request parameters, see API Reference.

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

SecurityPreferenceobject

The details of security preferences.

AccessKeyPreferenceobject

The AccessKey pair preference.

AllowUserToManageAccessKeysboolean

Indicates whether RAM users can manage their AccessKey pairs. Valid values:

  • true
  • false
false
LoginProfilePreferenceobject

The logon preference.

EnableSaveMFATicketboolean

Indicates whether RAM users can remember the multi-factor authentication (MFA) devices for seven days. Valid values:

  • true
  • false
false
LoginSessionDurationinteger

The validity period of the logon session of RAM users. Unit: hours.

6
LoginNetworkMasksstring

The subnet mask.

10.0.0.0/8
AllowUserToChangePasswordboolean

Indicates whether RAM users can change their passwords. Valid values:

  • true
  • false
true
OperationForRiskLoginstring

Indicates whether to enable MFA for RAM users who initiated unusual logons. Valid values:

  • autonomous (default): yes. MFA is prompted for RAM users who initiated unusual logons. However, the RAM users are allowed to skip MFA.
  • enforceVerify: MFA is prompted for RAM users who initiated unusual logons and the RAM users cannot skip MFA.
autonomous
MFAOperationForLoginstring

Indicates whether MFA is required for all RAM users when they log on to the Alibaba Cloud Management Console. Valid values:

  • mandatory: MFA is required for all RAM users. If you use EnforceMFAForLogin, set the value to true.
  • independent (default): User-specific settings are applied. If you use EnforceMFAForLogin, set the value to false.
  • adaptive: MFA is required only for RAM users who initiated unusual logons.
adaptive
AllowUserToLoginWithPasskeyboolean

Indicates whether a RAM user can use a passkey for logon. Valid values:

  • true
  • false
true
MFAPreferenceobject

The MFA preference.

AllowUserToManageMFADevicesboolean

Indicates whether RAM users can manage their MFA devices. Valid values:

  • true
  • false
false
VerificationPreferenceobject

The MFA method preference.

VerificationTypesarray

The MFA methods.

VerificationTypestring

The MFA method. Valid values:

  • sms: mobile phone
  • email: email
["sms","email"]
PersonalInfoPreferenceobject

The personal information preference.

AllowUserToManagePersonalDingTalkboolean

Indicates whether RAM users can manage their personal DingTalk accounts, such as binding and unbinding of the accounts. Valid values:

  • true
  • false
true
MaxIdleDaysobject

The maximum idle periods. Unit: days.

MaxIdleDaysForUsersinteger

The maximum number of days that a RAM user can stay idle. If a RAM user for whom console logon is enabled does not log on to the console in the previous specified number of days, console logon is automatically disabled for the RAM user on the next day. Single sign-on (SSO) is not involved. The default value is 730. You cannot change the value.

730
MaxIdleDaysForAccessKeysinteger

The maximum number of days that the AccessKey pair of a RAM user can stay unused. If an AccessKey pair is not used in the previous specified number of days, the AccessKey pair is automatically disabled on the next day. The default value is 730. You cannot change the value.

730
RequestIdstring

The request ID.

30C9068D-FBAA-4998-9986-8A562FED0BC3

Examples

Sample success responses

JSONformat

{
  "SecurityPreference": {
    "AccessKeyPreference": {
      "AllowUserToManageAccessKeys": false
    },
    "LoginProfilePreference": {
      "EnableSaveMFATicket": false,
      "LoginSessionDuration": 6,
      "LoginNetworkMasks": "10.0.0.0/8",
      "AllowUserToChangePassword": true,
      "OperationForRiskLogin": "autonomous",
      "MFAOperationForLogin": "adaptive",
      "AllowUserToLoginWithPasskey": true
    },
    "MFAPreference": {
      "AllowUserToManageMFADevices": false
    },
    "VerificationPreference": {
      "VerificationTypes": [
        "[\"sms\",\"email\"]"
      ]
    },
    "PersonalInfoPreference": {
      "AllowUserToManagePersonalDingTalk": true
    },
    "MaxIdleDays": {
      "MaxIdleDaysForUsers": 730,
      "MaxIdleDaysForAccessKeys": 730
    }
  },
  "RequestId": "30C9068D-FBAA-4998-9986-8A562FED0BC3"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2025-01-08The response structure of the API has changedView Change Details
2024-12-19The response structure of the API has changedView Change Details
2024-08-14API Description UpdateView Change Details
2023-03-20The response structure of the API has changedView Change Details
2023-01-06The response structure of the API has changedView Change Details
2021-08-11The response structure of the API has changedView Change Details
2021-08-11The response structure of the API has changedView Change Details