在 Microsoft Graph API 中将成员添加到目录角色 - 权限不足
Add Member to Directory Role in Microsoft Graph API - Insufficient Privileges
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 是我的令牌的角色之一,但是以下请求:
POST https://graph.microsoft.com/v1.0/directoryRoles/{directoryRoleObjectId}/members/$ref
{
"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{userObjectId}"
}
Returns:
{
"error": {
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",
"innerError": {
"request-id": "{id}",
"date": "2016-11-25T15:18:07"
}
}
}
运行 directoryRole returns 数据上的 GET,因此读取权限似乎有效。我错过了什么?
Directory.AccessAsUser.All(使用管理员帐户)允许您从目录角色 add/remove 用户。注意:这是委托权限。据我所知,没有其他权限允许此操作,我们需要修复我们的文档。我需要与我们的一些开发团队核实此事。
问你一个问题:为什么你需要使用应用程序权限,而不能使用委派权限?
希望对您有所帮助,
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 是我的令牌的角色之一,但是以下请求:
POST https://graph.microsoft.com/v1.0/directoryRoles/{directoryRoleObjectId}/members/$ref
{
"@odata.id": "https://graph.microsoft.com/v1.0/directoryObjects/{userObjectId}"
}
Returns:
{
"error": {
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",
"innerError": {
"request-id": "{id}",
"date": "2016-11-25T15:18:07"
}
}
}
运行 directoryRole returns 数据上的 GET,因此读取权限似乎有效。我错过了什么?
Directory.AccessAsUser.All(使用管理员帐户)允许您从目录角色 add/remove 用户。注意:这是委托权限。据我所知,没有其他权限允许此操作,我们需要修复我们的文档。我需要与我们的一些开发团队核实此事。
问你一个问题:为什么你需要使用应用程序权限,而不能使用委派权限?
希望对您有所帮助,