active-directory - Write requests are only supported on contained entities, Microsoft Graph API when trying to PATCH/POST to assign AD App role to user
问题描述
I'm trying to assign app-specific roles to a user in our AD group using Microsoft Graph.
The link I'm sending the request to:
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}
Inside the request:
{"id": "ID of the role I'm trying to assign to the user"}
The error:
"code": "BadRequest",
"message": "Write requests are only supported on contained entities",
The documentation doesn't define parameters in the example well and I've tried various possibilities but this is the only meaningful result I've gotten.
解决方案
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}"
}
推荐阅读
- javascript - map() 作为 setState() 中的回调在 React 中奇怪地运行条件两次
- soap - 如何在 localhost 中托管 SOAP Web 服务 WSDL?
- javascript - 声明一个普通的打字稿方法和一个 lambda 函数有什么区别吗?
- bash - 从 shell 脚本中读取命令行参数
- c++ - 在使用 nlohmann::json 时使用 std::eof 读取 json 文件
- node.js - Node.js - 检查特定的 CharSet
- modelica - 在作用域 _ 中找不到函数 _
- python-3.x - Python3 Web-scraping无法登录页面?时间戳?
- python - 如何保存由内置身份验证实现的用户表单中的数据。用户在 Django 中使用 UserCreationForm?
- javascript - VideoJS v7.7.6 - player.qualityLevels() 不适用于 VHS