更新 authenticationEventsFlow

命名空间:microsoft.graph

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

API 可用性

此 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