azure - 使用 Microsoft.Graph 的 Azure Active Directory 中广告用户的扩展属性
问题描述
您好我正在尝试使用 Microsoft.Graph 包向 azure 广告用户添加扩展属性。
var schema = new SchemaExtension()
{
Id = "Location",
TargetTypes = new List<string> { "User" },
Description = "DescribesLocation",
Properties = new List<ExtensionSchemaProperty>() { new ExtensionSchemaProperty { Name = "LocationCode", Type = "String" } }
};
var result = graphClient.SchemaExtensions.Request().AddAsync(schema).Result;
我在 azure ad 注册应用程序中创建了一个守护程序应用程序,并为该应用程序提供了以下权限
- 目录.阅读.全部
- Directory.ReadWrite.All
- User.Invite.All
- 用户读
- 用户阅读全部
- User.ReadWrite.All
- 组读全部
- Group.ReadWrite.All
我收到错误消息,代码:Authorization_RequestDenied 消息:权限不足,无法完成操作。此操作还需要哪些其他权限,哪些不需要?
解决方案
您需要Directory.AccessAsUser.All权限。以下是一些您可能会发现有用的测试用例。
推荐阅读
- css - 浮动内容
- firebase - Firebase 安装并首次在 iOS 上运行后不显示通知
- visual-studio-code - 在 Vscode 的区块链平台扩展中将客户端应用程序连接到在本地结构网络上运行的 Nodejs 链代码
- vue.js - Vuestorefront without SSR - asyncData not triggered
- javascript - 带有 Google Sheet API 的 Live Json 数据搜索 Ajax jQuery
- c++ - 为什么我会收到“运行时错误:AddressSanitizer:致命信号”?
- gerrit - 如何通过 REST API 获取 gerrit 中的历史消息
- r - renv::restore() 错误:无法检索“包”(使用私有包)
- c# - Enviroment.Exit 后启动进程
- firebase - 如何在 Flutter 和 Firebase 中添加打卡和打卡功能?