使用Microsoft.Graph的天蓝色活动目录中广告用户的扩展属性

时间:2018-12-14 11:28:41

标签: azure microsoft-graph microsoft-graph-sdks

嗨,我正在尝试使用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广告注册的应用程序中创建了一个守护程序应用程序,并在下面授予了该应用程序的权限

  1. Directory.Read.All
  2. Directory.ReadWrite.All
  3. User.Invite.All
  4. User.Read
  5. User.Read.All
  6. User.ReadWrite.All
  7. Group.Read.All
  8. Group.ReadWrite.All

我收到以下错误消息,代码为:Authorization_RequestDenied 消息:特权不足,无法完成操作。此操作还需要其他哪些权限,而又不需要哪些权限?

1 个答案:

答案 0 :(得分:0)

您需要Directory.AccessAsUser.All权限。这里有一些test cases,您可能会觉得有用。

相关问题