我正在尝试使用 Microsoft Graph 为我们 AD 组中的用户分配特定于应用程序的角色。
我将请求发送到的链接:https://graph.microsoft.com/beta/users/{oID of the user I want to assign the role to}/appRoleAssignments/{Object ID of the AD enterprise app}
在请求中:{"id": "ID of the role I'm trying to assign to the user"}
错误:"code": "BadRequest", "message": "Write requests are only supported on contained entities",
文档没有很好地定义示例中的参数,我尝试了各种可能性,但这是我得到的唯一有意义的结果。
最佳答案
Microsoft Graph 当前不支持此功能。若要创建应用角色分配,需要使用 Azure AD Graph:
POST https://graph.windows.net/myorganization/users/{user-object-id}/appRoleAssignments
{
"principalId": "{user-object-id}",
"resourceId": "{service-principal-object-id}",
"id": "{app-role-id}"
}
关于active-directory - 尝试 PATCH/POST 以将 AD 应用程序角色分配给用户时,仅包含的实体、Microsoft Graph API 支持写入请求,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/52764985/