通过Graph API创建它们时,我们可以在Azure AD组中添加额外的声明吗?

问题描述 投票:0回答:1

当我们通过图形API在azure ad b2c中创建Azure AD组时,可以向Azure AD组添加其他属性。就像我们为用户做的一样(我们可以向用户添加声明)

我无法为此找到任何资源。让我知道是否可能。谢谢!

azure azure-active-directory azure-ad-b2c azure-ad-graph-api
1个回答
0
投票

是。您可以这样做。

在Azure AD B2C下找到“ b2c-extensions-app”-Azure AD B2C中的应用程序注册(预览)。该应用程序将扩展属性存储在Azure AD B2C中。记录其对象ID。

使用以下调用在上述应用中注册扩展程序。参考here

POST https://graph.windows.net/{your B2C tenant}/applications/<applicationObjectId>/extensionProperties
{
    "name": "customAttribute",
    "dataType": "String",
    "targetObjects": [
        "Group"
    ]
}

然后您将在响应中获得Group的扩展名:extension_{client id of b2c-extensions-app}_customAttribute

现在使用扩展名属性创建一个组。

POST https://graph.windows.net/{your B2C tenant}/groups
{
  "displayName": "Example Group",
  "mailNickname": "ExampleGroup",
  "mailEnabled": false,
  "securityEnabled": true,
  "extension_{client id of b2c-extensions-app}_customAttribute": "customAttribute for group"
}
© www.soinside.com 2019 - 2024. All rights reserved.