根据本文,应该可以使用Microsoft Graph API:https://docs.microsoft.com/en-us/azure/active-directory-b2c/microsoft-graph-operations(更具体地说:https://docs.microsoft.com/en-us/graph/api/user-delete)从Azure AD B2C删除用户
我已经设置了 User.ReadWrite.All 权限(对于权限类型为Application)并获得了管理员的同意。
但是,当使用http DELETE请求调用相应的端点时,它将失败并显示以下响应:
{
"odata.error": {
"code": "Authorization_RequestDenied",
"message": {
"lang": "en",
"value": "Insufficient privileges to complete the operation."
},
"requestId": "b129b3a7-a0e9-42db-aa7a-97da31590095",
"date": "2020-11-04T12:53:32"
}
}
其他操作(例如列出和更新用户)可以很好地工作。有谁知道是什么原因导致这种现象?非常感谢您的帮助。
这是我尝试发送到Graph API的请求的示例: Postman Curl request
答案 0 :(得分:0)
确保您正在调用Microsoft Graph,并且配置的权限在Microsoft Graph下。
根据您的Curl请求,您正在调用Azure AD图(端点https://graph.windows.net
)。
Microsoft Graph端点为https://graph.microsoft.com
。
如果在Microsoft Graph下正确设置了权限,请尝试使用DELETE https://graph.microsoft.com/v1.0/users/{user-id}
删除用户。