在认证器通知中使用额外的上下文信息 - 身份验证方法策略

本文介绍如何通过将登录的应用程序名称和地理位置添加到 Authenticator 无密码和推送通知来提高用户登录的安全性。

先决条件

  • 你的组织需要使用新的身份验证方法策略来为某些用户或组启用 Authenticator 的无密码功能和推送通知。 可以使用 Microsoft Entra 管理中心或 Microsoft Graph API 编辑身份验证方法策略。
  • 其他上下文只能面向单个组,可以是动态的,也可以是嵌套的。 该组可以从本地或仅云端进行同步。

无密码手机登录和多重身份验证

当用户在 Authenticator 中收到电话免密码登录或多重身份验证(MFA)推送通知时,他们会看到请求审批的应用程序名称以及登录源自的 IP 地址的位置信息。

屏幕截图显示 MFA 推送通知中其他上下文。

管理员可将其他上下文与数字匹配结合使用,以进一步提高登录安全性。

屏幕截图显示 MFA 推送通知中具有数字匹配的其他上下文。

策略架构更改

可以单独启用和禁用应用程序名称和地理位置。 在 featureSettings 下,可以为每项功能使用以下名称映射:

  • 应用程序名称displayAppInformationRequiredState
  • 地理位置displayLocationInformationRequiredState

注意

请确保对 Microsoft Graph API 使用新策略架构。 在 Graph 资源管理器中,需要同意 Policy.Read.AllPolicy.ReadWrite.AuthenticationMethod 权限。

为每个功能确定单一目标组。 然后使用以下 API 端点将 featureSettings 下的 displayAppInformationRequiredStatedisplayLocationInformationRequiredState properties 更改为 enabled,并包含或排除你想要的组:

GET https://graph.microsoft.com/v1.0/authenticationMethodsPolicy/authenticationMethodConfigurations/MicrosoftAuthenticator

有关详细信息,请参阅 microsoftAuthenticatorAuthenticationMethodConfiguration 资源类型

如何为所有用户启用其他上下文的示例

featureSettings中,将 displayAppInformationRequiredStatedisplayLocationInformationRequiredStatedefault 更改为 enabled

身份验证模式的值是 any 还是 push,具体取决于是否还要启用无密码电话登录。 在这些示例中,我们使用 any,但如果不想允许无密码,请使用 push

可能需要 PATCH 整个架构以防止覆盖任何以前的配置。 在这种情况下,请先执行 GET。 然后仅更新相关字段,然后 PATCH。 以下示例演示如何在 featureSettings下更新 displayAppInformationRequiredStatedisplayLocationInformationRequiredState

只有 includeTargets 下为 Authenticator 启用的用户才能看到应用程序名称或地理位置。 未为 Authenticator 启用的用户看不到这些功能。

//Retrieve your existing policy via a GET. 
//Leverage the Response body to create the Request body section. Then update the Request body similar to the Request body as shown below.
//Change the Query to PATCH and Run query
 
{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodConfigurations/$entity",
    "@odata.type": "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration",
    "id": "MicrosoftAuthenticator",
    "state": "enabled",
    "featureSettings": {
        "displayAppInformationRequiredState": {
            "state": "enabled",
            "includeTarget": {
                "targetType": "group",
                "id": "all_users"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "00000000-0000-0000-0000-000000000000"
            }
        },
        "displayLocationInformationRequiredState": {
            "state": "enabled",
            "includeTarget": {
                "targetType": "group",
                "id": "all_users"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "00000000-0000-0000-0000-000000000000"
            }
        }
    },
    "includeTargets@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')/microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration/includeTargets",
    "includeTargets": [
        {
            "targetType": "group",
            "id": "all_users",
            "isRegistrationRequired": false,
            "authenticationMode": "any",
        }
    ]
} 

如何为不同组启用应用程序名称和地理位置的示例

featureSettings中,将 displayAppInformationRequiredStatedisplayLocationInformationRequiredStatedefault 更改为 enabled。 在每个 featureSettingincludeTarget 内,将 ID 从 all_users 更改为Microsoft Entra 管理中心中组的对象 ID。

需要 PATCH 整个架构,以防止覆盖任何以前的配置。 建议先执行 GET。 然后仅更新相关字段,然后 PATCH。 以下示例显示对 featureSettings下的 displayAppInformationRequiredStatedisplayLocationInformationRequiredState 的更新。

只有 includeTargets 下为 Authenticator 启用的用户才能看到应用程序名称或地理位置。 未为 Authenticator 启用的用户看不到这些功能。

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodConfigurations/$entity",
    "@odata.type": "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration",
    "id": "MicrosoftAuthenticator",
    "state": "enabled",
    "featureSettings": {
        "displayAppInformationRequiredState": {
            "state": "enabled",
            "includeTarget": {
                "targetType": "group",
                "id": "44561710-f0cb-4ac9-ab9c-e6c394370823"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "00000000-0000-0000-0000-000000000000"
            }
        },
        "displayLocationInformationRequiredState": {
            "state": "enabled",
            "includeTarget": {
                "targetType": "group",
                "id": "a229e768-961a-4401-aadb-11d836885c11"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "00000000-0000-0000-0000-000000000000"
            }
        }
    },
    "includeTargets@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')/microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration/includeTargets",
    "includeTargets": [
        {
            "targetType": "group",
            "id": "all_users",
            "isRegistrationRequired": false,
            "authenticationMode": "any",
        }
    ]
}

若要验证,请再次运行 GET 并验证对象 ID:

GET https://graph.microsoft.com/v1.0/authenticationMethodsPolicy/authenticationMethodConfigurations/MicrosoftAuthenticator

如何禁用应用程序名称并仅启用地理位置的示例

featureSettings中,将 displayAppInformationRequiredState 的状态更改为 defaultdisabled,并将 displayLocationInformationRequiredState 更改为 enabled。 在每个 featureSetting 值的 includeTarget 内,将 ID 从 all_users 更改为Microsoft Entra 管理中心中组的对象 ID。

需要 PATCH 整个架构,以防止覆盖任何以前的配置。 建议先执行 GET。 然后仅更新相关字段,然后 PATCH。 以下示例展示了对 featureSettings下的 displayAppInformationRequiredStatedisplayLocationInformationRequiredState 的更新。

只有 includeTargets 下为 Authenticator 启用的用户才能看到应用程序名称或地理位置。 未为 Authenticator 启用的用户看不到这些功能。

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodConfigurations/$entity",
    "@odata.type": "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration",
    "id": "MicrosoftAuthenticator",
    "state": "enabled",
    "featureSettings": {
        "displayAppInformationRequiredState": {
            "state": "disabled",
            "includeTarget": {
                "targetType": "group",
                "id": "44561710-f0cb-4ac9-ab9c-e6c394370823"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "00000000-0000-0000-0000-000000000000"
            }
        },
        "displayLocationInformationRequiredState": {
            "state": "enabled",
            "includeTarget": {
                "targetType": "group",
                "id": "a229e768-961a-4401-aadb-11d836885c11"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "00000000-0000-0000-0000-000000000000"
            }
        }
    },
    "includeTargets@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')/microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration/includeTargets",
    "includeTargets": [
        {
            "targetType": "group",
            "id": "all_users",
            "isRegistrationRequired": false,
            "authenticationMode": "any",
        }
    ]
}

如何从应用程序名称和地理位置中排除组的示例

此外,为每个功能将 excludeTarget 的 ID 更改为 Microsoft Entra 管理中心内组的 ObjectID。 此次更改将该组排除在查看应用程序名称和地理位置之外。

需要 PATCH 整个架构,以防止覆盖任何以前的配置。 建议先执行 GET。 然后仅更新相关字段,然后 PATCH。 以下示例演示对 featureSettingsdisplayAppInformationRequiredStatedisplayLocationInformationRequiredState 的更新。

只有 includeTargets 下为 Authenticator 启用的用户才能看到应用程序名称或地理位置。 未为 Authenticator 启用的用户看不到这些功能。

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodConfigurations/$entity",
    "@odata.type": "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration",
    "id": "MicrosoftAuthenticator",
    "state": "enabled",
    "featureSettings": {
        "displayAppInformationRequiredState": {
            "state": "enabled",
            "includeTarget": {
                "targetType": "group",
                "id": "44561710-f0cb-4ac9-ab9c-e6c394370823"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "5af8a0da-5420-4d69-bf3c-8b129f3449ce"
            }
        },
        "displayLocationInformationRequiredState": {
            "state": "enabled",
            "includeTarget": {
                "targetType": "group",
                "id": "a229e768-961a-4401-aadb-11d836885c11"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "b6bab067-5f28-4dac-ab30-7169311d69e8"
            }
        }
    },
    "includeTargets@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')/microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration/includeTargets",
    "includeTargets": [
        {
            "targetType": "group",
            "id": "all_users",
            "isRegistrationRequired": false,
            "authenticationMode": "any",
        }
    ]
}

删除排除组的示例

featureSettings中,将 displayAppInformationRequiredState 的状态从 default 更改为 enabled。 将 excludeTarget 的 ID 更改为 00000000-0000-0000-0000-000000000000

需要 PATCH 整个架构,以防止覆盖任何以前的配置。 建议先执行 GET。 然后仅更新相关字段,然后 PATCH。 以下示例演示对 featureSettingsdisplayAppInformationRequiredStatedisplayLocationInformationRequiredState 的更新。

只有 includeTargets 下为 Authenticator 启用的用户才能看到应用程序名称或地理位置。 未为 Authenticator 启用的用户看不到这些功能。

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodConfigurations/$entity",
    "@odata.type": "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration",
    "id": "MicrosoftAuthenticator",
    "state": "enabled",
    "featureSettings": {
        " displayAppInformationRequiredState ": {
            "state": "enabled",
            "includeTarget": {
                "targetType": "group",
                "id": "1ca44590-e896-4dbe-98ed-b140b1e7a53a"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": " 00000000-0000-0000-0000-000000000000"
            }
        }
    },
    "includeTargets@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')/microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration/includeTargets",
    "includeTargets": [
        {
            "targetType": "group",
            "id": "all_users",
            "isRegistrationRequired": false,
            "authenticationMode": "any"
        }
    ]
}

关闭其他上下文

若要关闭其他上下文,需要从 enabled PATCHdisplayAppInformationRequiredStatedisplayLocationInformationRequiredStatedisabled/default。 还可以仅关闭其中一项功能。

{
    "@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodConfigurations/$entity",
    "@odata.type": "#microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration",
    "id": "MicrosoftAuthenticator",
    "state": "enabled",
    "featureSettings": {
        "displayAppInformationRequiredState": {
            "state": "disabled",
            "includeTarget": {
                "targetType": "group",
                "id": "44561710-f0cb-4ac9-ab9c-e6c394370823"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "00000000-0000-0000-0000-000000000000"
            }
        },
        "displayLocationInformationRequiredState": {
            "state": "disabled",
            "includeTarget": {
                "targetType": "group",
                "id": "a229e768-961a-4401-aadb-11d836885c11"
            },
            "excludeTarget": {
                "targetType": "group",
                "id": "00000000-0000-0000-0000-000000000000"
            }
        }
    },
    "includeTargets@odata.context": "https://graph.microsoft.com/v1.0/$metadata#authenticationMethodsPolicy/authenticationMethodConfigurations('MicrosoftAuthenticator')/microsoft.graph.microsoftAuthenticatorAuthenticationMethodConfiguration/includeTargets",
    "includeTargets": [
        {
            "targetType": "group",
            "id": "all_users",
            "isRegistrationRequired": false,
            "authenticationMode": "any",
        }
    ]
}

在 Microsoft Entra 管理中心启用其他上下文

若要在 Microsoft Entra 管理中心中启用应用程序名称或地理位置,请执行以下步骤:

  1. 至少以身份验证策略管理员的身份登录到 Microsoft Entra 管理中心

  2. 浏览到“保护”“身份验证方法”>“Microsoft Authenticator”。

  3. 在“基本信息”选项卡上,选择“是”和“所有用户”以便为所有人启用策略。 将 身份验证模式 更改为 任意

    只有在此处启用了 Authenticator 的用户才会包含在此策略中,以显示登录的应用程序名称或地理位置,否则会将其排除在此策略外。 未为 Authenticator 启用的用户看不到应用程序名称或地理位置。

    显示如何为任何身份验证模式启用验证器设置的屏幕截图。

  4. 在“配置”选项卡上,对于“在推送和无密码通知中显示应用程序名称”,将“状态”更改为“启用”。 选择要从策略中包含或排除的人员,然后选择 保存

    显示如何启用应用程序名称的屏幕截图。

    然后,对于“在推送和无密码通知中显示地理位置”,执行相同的操作。

    显示如何启用地理位置的屏幕截图。

    可以单独配置应用程序名称和地理位置。 例如,以下策略为所有用户启用应用程序名称和地理位置,但从查看地理位置中排除操作组。

    显示如何单独启用应用程序名称和地理位置的屏幕截图。

已知问题

  • 网络策略服务器 (NPS) 或 Active Directory 联合身份验证服务不支持其他上下文。

  • 用户可以修改 iOS 和 Android 设备报告的位置。 因此,Authenticator 正在更新其基于位置的访问控制 (LBAC) 条件访问策略的安全基线。 验证器拒绝身份验证,因为用户可能使用的是与安装了 Authenticator 的移动设备的实际 GPS 位置不同的位置。

    在 Authenticator 的 2023 年 11 月版本中,修改设备位置的用户在执行 LBAC 身份验证时在 Authenticator 中看到拒绝消息。 从 2024 年 1 月开始,运行较旧 Authenticator 版本的任何用户都将被阻止使用修改位置的 LBAC 身份验证:

    • Android 上的 Authenticator 版本 6.2309.6329 或更早版本
    • iOS 上的 Authenticator 版本 6.7.16 或更早版本

    若要查找哪些用户在运行旧版 Authenticator,请使用 Microsoft Graph API