简体   繁体   English

无法从 Azure AD B2C 中删除用户

[英]Unable to delete user from Azure AD B2C

According to this article it should be possible to delete a user from Azure AD B2C using the Microsoft Graph API: https://docs.microsoft.com/en-us/azure/active-directory-b2c/microsoft-graph-operations (more specifically: https://docs.microsoft.com/en-us/graph/api/user-delete )根据这篇文章,应该可以使用 Microsoft Graph API 从 Azure AD B2C 中删除用户: https : //docs.microsoft.com/en-us/azure/active-directory-b2c/microsoft-graph-operations (更具体地说: https : //docs.microsoft.com/en-us/graph/api/user-delete

I have set the User.ReadWrite.All permission (for permission type Application) and granted admin consent.我已经设置了User.ReadWrite.All权限(对于权限类型应用程序)并授予管理员同意。

However, when calling the corresponding endpoint with a http DELETE request, it fails with the following response:但是,当使用 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"
     }
 }

Other operations (such as listing and updating users) work perfectly fine.其他操作(例如列出和更新用户)工作正常。 Does anyone know what causes this behavior?有谁知道是什么导致了这种行为? Any help is highly appreciated.任何帮助都受到高度赞赏。

Update:更新:

This is a sample of a request which I try to send to the Graph API: Postman Curl request这是我尝试发送到 Graph API 的请求示例: Postman Curl request

Make sure you are calling Microsoft Graph and the configured permissions are under Microsoft Graph.确保您正在调用 Microsoft Graph 并且配置的权限在 Microsoft Graph 下。

Based on your Curl request, you are calling Azure AD Graph (endpoint https://graph.windows.net ).根据您的 Curl 请求,您正在调用 Azure AD Graph(端点https://graph.windows.net )。

The Microsoft Graph endpoint is https://graph.microsoft.com . Microsoft Graph 端点是https://graph.microsoft.com

If your permissions are set correctly under Microsoft Graph, try to use DELETE https://graph.microsoft.com/v1.0/users/{user-id} to delete the user.如果您的权限在 Microsoft Graph 下设置正确,请尝试使用DELETE https://graph.microsoft.com/v1.0/users/{user-id}删除用户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM