当我们通过图形API在azure ad b2c中创建Azure AD组时,可以向Azure AD组添加其他属性。就像我们为用户做的一样(我们可以向用户添加声明)
我无法为此找到任何资源。让我知道是否可能。谢谢!
是。您可以这样做。
在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"
}