azure-active-directory - 尝试更新 'mobilePhone' 时 Microsoft Graph API 权限不足

标签 azure-active-directory microsoft-graph-api

尝试更新 ( PATCH ) 用户的 mobilePhone 时属性使用应用程序权限,来自 Graph 的响应是“没有足够的权限来完成操作”( Authorization_RequestDenied )。

两者User.ReadWrite.AllDirectory.ReadWrite.All授予权限。通过 client_credentials 请求访问 token 授予(oauth2/v2.0/token 端点)并指定 .default范围和两个权限都存在于 role 中在访问 token 中声明。

更新其他属性工作正常。错误仅在更新 mobilePhone 时出现属性并且仅具有应用程序权限(使用具有管理员用户的图形资源管理器工作)。

这种行为突然开始于2018年10月2日。在此之前,更新手机属性也适用于应用程序权限(相同的权限)。

据我所知,用户 PATCH 的 Graph 文档中没有添加新的限制/必需的权限。请求或 mobilePhone属性(property)。这里可能是什么问题?

注意:请求是使用 Microsoft.Graph.GraphServiceClient (.NET Standard) 发出的,但在使用 Postman 发出请求时,同样的行为也是如此。

编辑:

这是来自 Graph API 的响应:

{
    "error": {
        "code": "Authorization_RequestDenied",
        "message": "Insufficient privileges to complete the operation.",
        "innerError": {
            "request-id": "e956cb0b-af0a-4bb7-aae3-59d39d007a82",
            "date": "2018-10-11T08:27:19"
        }
    }
}

最佳答案

我们的团队遇到了同样的问题,我们向 Microsoft 提出了支持请求并解决了该问题。

解决方法是添加帮助台管理员 作用到服务主体/企业申请 .

Microsoft 更改了更新 PII 的安全策略并更改了允许更新的安全角色。

以下是我们的支持请求回答中的更多内容:

The reason that this is occurring is because there was a recent change due to new PII sensitivity issues.

So now you will need to add the Helpdesk Administrator role to the Service Principal/Enterprise application now.

You can do this by following the article here : https://blogs.msdn.microsoft.com/aaddevsup/2018/08/29/how-to-add-an-azure-ad-role-to-a-enterprise-application-service-principal/

This is to modify values such as : mobile/othermails/telephonenumber attributes.

关于azure-active-directory - 尝试更新 'mobilePhone' 时 Microsoft Graph API 权限不足,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52626067/

相关文章:

oauth-2.0 - OpenIdConnectAuthenticationOptions 和 AcquireTokenByAuthorizationCodeAsync : Invalid JWT token

sharepoint - 使用 Microsoft Graph SDK 的 OneDrive 复制项目 - 如果 ~>38mb 文件,则 GatewayTimeout 为 10 秒

通过 Powershell 注册 Azure AD 应用程序 : How to ensure the proper permissions?

Azure CLI : get object id from user name or email address

c# - 客户端通过 Azure AD 应用程序代理发出的请求中缺少授权 header

Azure Active Directory Sharepoint 和 Graph API

c# - 从 Azure Active Directory 获取 MVC Web App 中的 samAccountName 名称

microsoft-graph-api - 查找 Microsoft Graph 范围

postman - 如何修复 - 更新 plannertaskdetails - If-Match header 包含无效值

c# - 尝试使用 Microsoft Graph API v1.0 查询用户的 Office365 个人资料照片时获取 "ErrorAccessDenied"