
# 设置实例配置信息 - UpdateSsoConfiguration
#### 功能介绍
设置IAM身份中心服务实例配置信息，包括身份认证配置和会话管理配置信息。此操作只能由组织的管理账号或作为服务委托管理员的成员账号调用。
#### 授权信息
账号根用户具备所有API的调用权限，如果使用账号下的IAM用户调用当前API，该IAM用户需具备如下身份策略权限，更多的权限说明请参见[权限和授权项](https://support.huaweicloud.com/api-identitycenter/iic_04_0028.html)。
| 授权项                                    | 访问级别  | 资源类型（\*为必须） | 条件键 | 别名 | 依赖的授权项                                     |
|:---|:---|:---|:---|:---|:---|
| IdentityCenter:ssoConfiguration:update | Write | -           | -   | -  | organizations:delegatedAdministrators:list |
   
#### 调试
您可以在[API Explorer](https://console.huaweicloud.com/apiexplorer/#/openapi/IdentityCenter/doc?api=UpdateSsoConfiguration)中调试该接口，支持自动认证鉴权。API Explorer可以自动生成SDK代码示例，并提供SDK代码示例调试功能。
#### URI
POST /v1/instances/{instance_id}/sso-configuration
表1路径参数 
| 参数          | 是否必选 | 参数类型   | 描述                                |
|:---|:---|:---|:---|
| instance_id | 是    | String | IAM Identity Center实例的全局唯一标识符（ID） |
   
#### 请求参数
表2请求Header参数 
| 参数               | 是否必选 | 参数类型   | 描述                                              |
|:---|:---|:---|:---|
| X-Security-Token | 否    | String | 如果正在使用临时安全凭据，则此header是必需的，该值是临时安全凭据的安全令牌（会话令牌）。 |
   
表3请求Body参数 
| 参数                 | 是否必选 | 参数类型                                                                               | 描述     |
|:---|:---|:---|:---|
| sso_configuration  | 是    | [SSOConfigurationDto] object | 实例配置信息 |
| configuration_type | 是    | String                                                                             | 配置类型   |
   
 表4SSOConfigurationDto 
| 参数                          | 是否必选 | 参数类型                                                                                       | 描述                 |
|:---|:---|:---|:---|
| mfa_mode                    | 否    | String                                                                                     | MFA生效模式            |
| no_mfa_signin_behavior      | 否    | String                                                                                     | 未注册MFA情况下，可选择的登录行为 |
| no_password_signin_behavior | 否    | String                                                                                     | 没有密码情况下登录的行为       |
| allowed_mfa_types           | 否    | Array of strings                                                                           | 允许的MFA类型           |
| session_configuration       | 否    | [SessionConfigurationDto] object | 会话生效配置             |
   
 表5SessionConfigurationDto 
| 参数                     | 是否必选 | 参数类型   | 描述     |
|:---|:---|:---|:---|
| max_authentication_age | 是    | String | 会话生效时间 |
   
#### 响应参数
**状态码：200**
Successful
**状态码：400**
表6响应Body参数 
| 参数         | 参数类型   | 描述     |
|:---|:---|:---|
| error_code | String | 错误码    |
| error_msg  | String | 错误信息   |
| request_id | String | 请求唯一标识 |
   
**状态码：403**
表7响应Body参数 
| 参数                            | 参数类型   | 描述      |
|:---|:---|:---|
| error_code                    | String | 错误码     |
| error_msg                     | String | 错误信息    |
| request_id                    | String | 请求唯一标识  |
| encoded_authorization_message | String | 加密的错误信息 |
   
#### 请求示例
设置IAM Identity Center 服务实例配置信息，包括身份认证配置和会话管理配置信息。
```
POST https://{hostname}/v1/instances/{instance_id}/sso-configuration
{
  "sso_configuration" : {
    "mfa_mode" : "ALWAYS_ON",
    "no_mfa_signin_behavior" : "ALLOWED",
    "no_password_signin_behavior" : "BLOCKED",
    "allowed_mfa_types" : [ "TOTP" ],
    "session_configuration" : {
      "max_authentication_age" : "PT8H"
    }
  },
  "configuration_type" : "APP_AUTHENTICATION_CONFIGURATION"
}
```
#### 响应示例
无
#### 状态码
| 状态码 | 描述          |
|:---|:---|
| 200 | Successful  |
| 400 | Bad request |
| 403 | Forbidden   |
   
#### 错误码
请参见[错误码](https://support.huaweicloud.com/api-identitycenter/ErrorCode.html)。
