"mail" 字段在图表中没有唯一值 API

"mail" field doesn't have unique values in Graph API

我们遇到了一个问题,即我们无法始终通过电子邮件地址可靠地辨别用户,即多个用户可能拥有完全相同的地址。这打破了我们软件中依赖于唯一地址的逻辑,我们有几个支持案例,这会给我们的客户带来问题。

When we query a user in Graph API we can see their "mail" property as shown:
{
"@odata.id": "https://graph.microsoft.com/v2/.../directoryObjects/.../Microsoft.DirectoryServices.User";,
"businessPhones": [],
"displayName": "dep1",
"givenName": "dep1",
"jobTitle": null,
"mail": "user1@company.com",
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": null,
"userPrincipalName": "dep1@company.onmicrosoft.com",
"id": "<unique GUID 1>"
}

https://docs.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0 我们了解到“邮件”returns 主 SMTP,应该是唯一的。

但是,如果您将用户从本地迁移到云端,您会看到该用户具有相同的“邮件”字段:

"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users";,
"value": [
{
"@odata.id": "https://graph.microsoft.com/v2/.../directoryObjects/.../Microsoft.DirectoryServices.User";,
"businessPhones": [],
"displayName": "ev1",
"givenName": "ev1",
"jobTitle": null,
"mail": "user1@company.com",
"mobilePhone": null,
"officeLocation": null,
"preferredLanguage": null,
"surname": null,
"userPrincipalName": "user12345@company.onmicrosoft.com",
"id": "<unique GUID 2>"
},

根据这篇文章:https://support.microsoft.com/en-us/topic/how-to-use-smtp-matching-to-match-on-premises-user-accounts-to-office-365-user-accounts-for-directory-synchronization-75673b94-e1b8-8a9e-c413-ee5a2a1a6a78#:~:text=The%20cloud%20user%27s%20primary%20SMTP,have%20the%20same%20SMTP%20address 这不应该被允许或不应该发生?也许它描述了一个不同的场景。

所以我们现在有两个用户具有相同的“邮件”字段,该字段应该具有唯一值。为什么“邮件”不是唯一的?我们应该做什么,或者我们应该使用什么作为用户唯一的 SMTP 地址?也许“proxyAddresses”字段中的某些值如下所示?

"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users(id,displayName,userPrincipalName,onPremisesSecurityIdentifier,mail,proxyAddresses,officeLocation,assignedPlans)/$entity";,
"id": "<unique GUID 1>",
"displayName": "dep1",
"userPrincipalName": "dep1@company.onmicrosoft.com",
"onPremisesSecurityIdentifier": null,
"mail": "user1@company.com",
"proxyAddresses": [
"SMTP:user1@company.com",
"smtp:dep1@company.onmicrosoft.com"
],
"officeLocation": null,
"assignedPlans": [
{

谢谢!

MS 支持人员已澄清,虽然这种情况是可能发生的,但这是他们计划修复的 Azure AD 中的一个错误。