One of the following scopes is required to execute this API: Directory.ReadWrite.All OR Directory.AccessAsUser.All
http://jwt.calebb.net/确认 Directory.ReadWrite.All 是我的 token 的角色之一,但是以下请求:
POST https://graph.microsoft.com/v1.0/directoryRoles/{directoryRoleObjectId}/members/$ref
{
"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{userObjectId}"
}
返回:
{
"error": {
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",
"innerError": {
"request-id": "{id}",
"date": "2016-11-25T15:18:07"
}
}
}
对 DirectoryRole 运行 GET 会返回数据,因此读取权限似乎有效。我错过了什么?
最佳答案
Directory.AccessAsUser.All(使用管理员帐户)允许您在目录角色中添加/删除用户。注意:这是委托(delegate)权限。据我所知,没有其他权限允许此操作,我们需要修复我们的文档。我需要与我们的一些开发团队核实此事。
问您的问题:您需要使用应用程序权限而不能使用委派权限是否有原因?
希望这有帮助,
关于azure - 将成员添加到 Microsoft Graph API 中的目录角色 - 权限不足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40808329/