调用GetSecurityPreference查询RAM用户的全局安全首选项。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | GetSecurityPreference |
要执行的操作。取值:GetSecurityPreference。 |
关于公共请求参数的详情,请参见公共参数。
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
SecurityPreference | Object |
安全首选项信息。 |
|
AccessKeyPreference | Object |
访问密钥首选项。 |
|
AllowUserToManageAccessKeys | Boolean | false |
是否允许RAM用户自主管理访问密钥。取值:
|
LoginProfilePreference | Object |
登录首选项。 |
|
EnableSaveMFATicket | Boolean | false |
RAM用户使用多因素认证登录后,是否允许保存多因素认证的验证状态,其有效期为7天。取值:
|
LoginSessionDuration | Integer | 6 |
RAM用户登录有效期。单位:小时。 |
LoginNetworkMasks | String | 10.0.0.0/8 |
登录掩码。 |
AllowUserToChangePassword | Boolean | true |
是否允许RAM用户自主管理密码。取值:
|
EnforceMFAForLogin | Boolean | false |
是否强制所有RAM用户在通过用户名和密码登录时必须启用多因素认证。取值:
|
MFAPreference | Object |
多因素认证首选项。 |
|
AllowUserToManageMFADevices | Boolean | false |
是否允许RAM用户自主管理多因素认证设备。取值:
|
PersonalInfoPreference | Object |
个人信息首选项。 |
|
AllowUserToManagePersonalDingTalk | Boolean | true |
是否允许RAM用户自主管理个人钉钉的绑定与解绑。取值:
|
RequestId | String | 30C9068D-FBAA-4998-9986-8A562FED0BC3 |
请求ID。 |
示例
请求示例
https://[Endpoint]/?Action=GetSecurityPreference
&<公共请求参数>
正常返回示例
XML
格式
HTTP/1.1 200 OK
Content-Type:application/xml
<GetSecurityPreferenceResponse>
<SecurityPreference>
<LoginProfilePreference>
<EnforceMFAForLogin>false</EnforceMFAForLogin>
<LoginSessionDuration>6</LoginSessionDuration>
<LoginNetworkMasks/>
<AllowUserToChangePassword>true</AllowUserToChangePassword>
<EnableSaveMFATicket>false</EnableSaveMFATicket>
</LoginProfilePreference>
<PersonalInfoPreference>
<AllowUserToManagePersonalDingTalk>true</AllowUserToManagePersonalDingTalk>
</PersonalInfoPreference>
<AccessKeyPreference>
<AllowUserToManageAccessKeys>false</AllowUserToManageAccessKeys>
</AccessKeyPreference>
<MFAPreference>
<AllowUserToManageMFADevices>true</AllowUserToManageMFADevices>
</MFAPreference>
</SecurityPreference>
<RequestId>30C9068D-FBAA-4998-9986-8A562FED0BC3</RequestId>
</GetSecurityPreferenceResponse>
JSON
格式
HTTP/1.1 200 OK
Content-Type:application/json
{
"SecurityPreference" : {
"LoginProfilePreference" : {
"EnforceMFAForLogin" : false,
"LoginSessionDuration" : 6,
"LoginNetworkMasks" : "",
"AllowUserToChangePassword" : true,
"EnableSaveMFATicket" : false
},
"PersonalInfoPreference" : {
"AllowUserToManagePersonalDingTalk" : true
},
"AccessKeyPreference" : {
"AllowUserToManageAccessKeys" : false
},
"MFAPreference" : {
"AllowUserToManageMFADevices" : true
}
},
"RequestId" : "30C9068D-FBAA-4998-9986-8A562FED0BC3"
}
错误码
访问错误中心查看更多错误码。