Azure active directory 如何从ASP.NET核心更新Azure AD B2C中的用户属性?

Azure active directory 如何从ASP.NET核心更新Azure AD B2C中的用户属性?,azure-active-directory,microsoft-graph-api,azure-ad-b2c,Azure Active Directory,Microsoft Graph Api,Azure Ad B2c,在不使用用户流的情况下,以编程方式更改Azure AD B2C自定义属性值的最佳方法是什么。应该使用Azure AD Graph还是新的Microsoft Graph?我找不到这样做的好文档。对于Azure AD B2C自定义属性,您应该使用Azure AD Graph 自定义属性以如下格式显示在AAD图形中:extension{appId}{customAttribute} 因此,首先需要获取它的appID。您可以使用带有筛选器的应用程序端点来获取应用程序ID:gethttps://graph

在不使用用户流的情况下,以编程方式更改Azure AD B2C自定义属性值的最佳方法是什么。应该使用Azure AD Graph还是新的Microsoft Graph?我找不到这样做的好文档。

对于Azure AD B2C自定义属性,您应该使用Azure AD Graph

自定义属性以如下格式显示在AAD图形中:
extension{appId}{customAttribute}

因此,首先需要获取它的appID。您可以使用带有筛选器的应用程序端点来获取应用程序ID:
gethttps://graph.windows.net/myorganization//applications?api-version=1.6&$filter=startswith(displayName,'b2c extensions app')

您可以获取扩展应用程序的appID。现在您知道了自定义属性的名称:
extension{appId}{customAttribute}

然后可以调用此端点来更新自定义属性

PATCH https://graph.windows.net/myorganization/users/userObjectId?api-version=1.6
{
    "extension_{appId}_{customAttribute}": "value"
}

嗨,这个问题有更新吗?