如何使用Graph API读取Azure B2C自定义属性(与Azure AD Graph兼容) [英] How to read Azure B2C Custom Attributes with Graph API (works OK with Azure AD Graph)
问题描述
从今天开始,文档建议使用Microsoft Graph代替Azure AD Graph API来访问Azure AD/B2C资源.
As of today the documentation recommends to use Microsoft Graph instead of Azure AD Graph API to access Azure AD / B2C resources.
在使用Azure AD Graph API之前,我们可以使用如下查询 https ://graph.windows.net/[tenant]/users/1a2a9c4d-fc59-4fd9-ad14-b72b549cdf6a?api-version = 2013-11-08
Before, with Azure AD Graph API, we could use queries like https://graph.windows.net/[tenant]/users/1a2a9c4d-fc59-4fd9-ad14-b72b549cdf6a?api-version=2013-11-08
,响应中包含Azure B2C自定义属性(在Azure门户上创建)
and the response included Azure B2C custom attributes (created on Azure portal)
{
"odata.metadata": "https://graph.windows.net/<tenant>/$metadata#directoryObjects/Microsoft.DirectoryServices.User",
"value": [
{
"objectId": "00000eab-603a-4de2-9d25-d3821e7d6583",
...
"extension_3a4189d71ad149c6ab5e65ac45bd6add_MyAttribute1": "something"
}
]
}
使用Graph API不会发生这种情况,只返回一些基本"属性 https://graph.microsoft.com/v1. 0/users/00000eab-603a-4de2-9d25-d3821e7d6583
This does not happen with the Graph API, only some "basic" attributes are returned https://graph.microsoft.com/v1.0/users/00000eab-603a-4de2-9d25-d3821e7d6583
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users/$entity",
"id": "00000eab-603a-4de2-9d25-d3821e7d6583",
...
}
还尝试显式选择属性,但未返回扩展值
Also tried to explicitly select the property but the extension value is not returned
... graph.microsoft.com/v1.0/users/00000eab-603a-4de2-9d25-d3821e7d6583/?$ select = id,extension_3a4189d71ad149c6ab5e65ac45bd6add_MyAttribute1
...graph.microsoft.com/v1.0/users/00000eab-603a-4de2-9d25-d3821e7d6583/?$select=id,extension_3a4189d71ad149c6ab5e65ac45bd6add_MyAttribute1
我们如何使用Graph API读取Azure B2C自定义属性?
How can we read Azure B2C custom attributes with Graph API?
推荐答案
请参阅此SO帖子: https://graph.windows.net 即可访问和管理您的B2C租户
See this SO post: As of today, we recommend that you use the Azure Active Directory Graph API https://graph.windows.net to access and manage your B2C tenants
这篇关于如何使用Graph API读取Azure B2C自定义属性(与Azure AD Graph兼容)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!