更新 authenticationEventsFlow

命名空间:microsoft.graph

按 ID 更新 authenticationEventsFlow 对象的属性。 必须指定要更新的 @odata.type 属性和 authenticationEventsFlow 对象类型的值。 支持以下派生子类型:

此 API 可用于以下国家级云部署

全局服务 美国政府 L4 美国政府 L5 (DOD) 由世纪互联运营的中国

权限

为此 API 选择标记为最低特权的权限。 只有在应用需要它时,才使用更高的特权权限。 有关委派权限和应用程序权限的详细信息,请参阅权限类型。 要了解有关这些权限的详细信息,请参阅 权限参考

权限类型 最低特权权限 更高特权权限
委派(工作或学校帐户) EventListener.ReadWrite.All 不可用。
委派(个人 Microsoft 帐户) 不支持。 不支持。
应用程序 EventListener.ReadWrite.All 不可用。

重要

在具有工作或学校帐户的委托方案中,登录用户必须是组的所有者或成员,或者分配有受支持的Microsoft Entra角色或具有支持的角色权限的自定义角色。 外部 ID用户流管理员是此操作支持的最低特权角色。

HTTP 请求

PATCH /identity/authenticationEventsFlows/{authenticationEventsFlow-id}

请求标头

名称 说明
Authorization 持有者 {token}。 必填。 详细了解 身份验证和授权
Content-Type application/json. 必需。

请求正文

在请求正文中, 提供要更新的属性的值。 请求正文中未包含的现有属性会保留其以前的值,或者根据对其他属性值的更改重新计算。

下表指定可更新的属性。

必须在正文中包含具有特定用户流类型的值的 @odata.type 属性。 例如,"@odata.type": "#microsoft.graph.externalUsersSelfServiceSignupEventsFlow"

属性 类型 说明
id String 实体的唯一标识符。 只读。
displayName String 事件策略的显示名称。
description String 事件策略的说明。
conditions authenticationConditions 表示身份验证请求上下文的条件,用于确定是否调用事件策略。
onInteractiveAuthFlowStart onInteractiveAuthFlowStartHandler 要为 onInteractiveAuthFlowStart 事件调用的内容的配置。
onAuthenticationMethodLoadStart onAuthenticationMethodLoadStartHandler 要为 onAuthenticationMethodLoadStart 事件调用的内容的配置。 必须至少链接一个标识提供者。
onAttributeCollection onAttributeCollectionHandler 要为 onAttributeCollection 事件调用的内容的配置。

  • 如果此属性是在创建用户流期间配置的,则只能更新此属性。 如果不是,请首先调用将 属性添加到用户流 API。
  • 无法通过更新 attributeCollectionPage>视图>输入和输出 对象来添加或删除 属性 。 改用“将属性添加到用户流”或“从用户流 API 中删除属性”来更新这两个对象。
  • 若要更新 attributeCollectionPage>视图>输入 集合,必须包括集合中的所有对象,而不仅仅是更改的对象。
  • attributeCollectionPage>视图>输入集合中对象的顺序对应于属性在应用的注册 UI 上显示的顺序。
  • onUserCreateStart onUserCreateStartHandler 要为 onUserCreateStart 事件调用的内容的配置。

    响应

    如果成功,此方法返回 204 No Content 响应代码。 如果失败,将返回错误 4xx ,其中包含特定详细信息。

    示例

    示例 1:更新外部标识自助注册用户流的显示名称

    请求

    以下示例演示更新特定外部标识用户流的显示名称的请求。

    PATCH https://graph.microsoft.com/v1.0/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e
    Content-Type: application/json
    
    {
      "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
      "displayName": "New user flow description",
    }
    

    响应

    以下示例显示了相应的响应。

    HTTP/1.1 204 No Content
    

    示例 2:更新自助注册用户流的页面布局

    以下请求更新某些属性的配置。 所有属性都标记为必需;电子邮件属性标记为隐藏;自定义属性的输入类型也会更新为具有两个选项的单选按钮。

    请求

    PATCH https://graph.microsoft.com/v1.0/identity/authenticationEventsFlows/0313cc37-d421-421d-857b-87804d61e33e
    Content-Type: application/json
    
    {
        "@odata.type": "#microsoft.graph.externalUsersSelfServiceSignUpEventsFlow",
        "onAttributeCollection": {
            "@odata.type": "#microsoft.graph.onAttributeCollectionExternalUsersSelfServiceSignUp",
            "attributeCollectionPage": {
                "views": [
                    {
                        "title": null,
                        "description": null,
                        "inputs": [
                            {
                                "attribute": "email",
                                "label": "Email Address",
                                "inputType": "text",
                                "defaultValue": null,
                                "hidden": true,
                                "editable": false,
                                "writeToDirectory": true,
                                "required": true,
                                "validationRegEx": "^[a-zA-Z0-9.!#$%&’'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:.[a-zA-Z0-9-]+)*$",
                                "options": []
                            },
                            {
                                "attribute": "displayName",
                                "label": "Display Name",
                                "inputType": "text",
                                "defaultValue": null,
                                "hidden": false,
                                "editable": true,
                                "writeToDirectory": true,
                                "required": true,
                                "validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
                                "options": []
                            },
                            {
                                "attribute": "city",
                                "label": "City",
                                "inputType": "text",
                                "defaultValue": null,
                                "hidden": false,
                                "editable": true,
                                "writeToDirectory": true,
                                "required": true,
                                "validationRegEx": "^[a-zA-Z_][0-9a-zA-Z_ ]*[0-9a-zA-Z_]+$",
                                "options": []
                            },
                            {
                                "attribute": "extension_331d514c0c18477583ea7dd5a79feda2_RockorCountry",
                                "label": "Rock music or Country",
                                "inputType": "radioSingleSelect",
                                "defaultValue": null,
                                "hidden": false,
                                "editable": true,
                                "writeToDirectory": true,
                                "required": true,
                                "validationRegEx": "^.*",
                                "options": [
                                    {
                                        "label": "Rock music",
                                        "value": "Rock"
                                    },
                                    {
                                        "label": "Country music",
                                        "value": "Country"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        }
    }
    

    响应

    以下示例显示了相应的响应。

    HTTP/1.1 204 No Content