【问题标题】:Unable to fetch details of B2B user using Azure Graph API无法使用 Azure Graph API 获取 B2B 用户的详细信息
【发布时间】:2019-12-13 19:18:04
【问题描述】:

Azure 的 Graph API 支持使用 this API 获取用户的详细信息。它支持 id 或 userPrincipalName(UPN)。对于 B2B 用户,要求是使用 UPN 获取详细信息。 Azure 为 B2B 用户创建的 UPN 格式如下 “B2BUserEmail#EXT#directoryid/租户”

使用上述UPN格式查询时

https://graph.microsoft.com/v1.0/users/b2buseremail.com#EXT#@<directory/tenant>

REST API 失败并给出以下错误

{ "error": { "code": "Request_ResourceNotFound", "message": "Resource 'b2buseremail.com' does not exist or one of its queried reference-property objects are not present.", "innerError": { "request-id": "d167220f-e0ef-4528-b7a5-de71fd524f07", "date": "2019-12-09T23:52:18" } } }

【问题讨论】:

    标签: azure azure-active-directory azure-ad-graph-api azure-ad-b2b


    【解决方案1】:

    目前 Azure Graph API 将“#”视为特殊字符,因此他们建议使用“%23”而不是“#”

    所以查询看起来像

    https://graph.microsoft.com/v1.0/users/b2buseremail.com%23EXT%23@<directory/tenant>

    【讨论】:

      猜你喜欢
      • 2015-07-19
      • 1970-01-01
      • 2023-01-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多