我正在编写单页应用程序,我正在尝试在我自己的 ms 配置文件中使用 MS Graph 修补 onPremisesExtensionAttributes,如下所示:
[PATCH] https://graph.microsoft.com/v1.0/users/{my-user-id}
{
"onPremisesExtensionAttributes" : {
"extensionAttribute10" : "test"
}
}
但是我收到一个错误:
{
"error": {
"code": "Authorization_RequestDenied",
"message": "Insufficient privileges to complete the operation.",
"innerError": {
"date": "2023-03-10T08:33:10",
"request-id": "1f20871c-e9f2-46df-bdce-21157212ef7a",
"client-request-id": "1f20871c-e9f2-46df-bdce-21157212ef7a"
}
}
}
我注册的应用程序有委托权限:
https://graph.microsoft.com/User.Read
https://graph.microsoft.com/User.ReadWrite
我尝试更新其他属性,如电话号码,它有效。问题仅在于 extensionAttribute 的。
在我自己的配置文件中更新 onPremisesExtensionAttributes 还需要哪些其他权限?
//更新:
当我添加 User.ReadWrite.All 权限时它可以工作,但我不想允许编辑用户其他人的个人资料。我只想允许编辑他自己的个人资料。