【问题标题】:Creating schemaExtension via graph explorer failing通过图形资源管理器创建 schemaExtension 失败
【发布时间】:2018-08-23 18:35:49
【问题描述】:

我尝试了以下查询来添加schemaExtension,但它以Authorization_RequestDenied 响应失败。

网址:https://graph.microsoft.com/v1.0/schemaExtensions/

发布数据:

{
  "id": "voctestextension",
  "description": "voc test extension",
  "targetTypes": ["User"],
  "properties": [
    {
      "name": "trainings",
      "type": "Integer"
    },
    {
      "name": "incidents",
      "type": "String"
    }
  ]
}

回应

{
  "error": {
    "code": "Authorization_RequestDenied",
    "message": "Insufficient privileges to complete the operation.",
    "innerError": {
      "request-id": "1d4d625d-99bc-46fc-9e7a-ac30d0840219",
      "date": "2018-03-14T13:17:45"
    }
  }
}

我已授予以下权限:

【问题讨论】:

    标签: json microsoft-graph-api


    【解决方案1】:

    在您发布到 Graph 的 JSON 中,您可以尝试设置 owner 属性吗?它应该是您已注册的应用程序的应用程序 ID。

    来自documentation page for creating schema extensions

    作为所有者的应用程序的 appId 架构扩展。此属性可以在创建时提供,以设置 主人。如果未提供,则调用应用程序的 appId 将 被设置为所有者。因此,例如,如果创建一个新模式 使用 Graph Explorer 的扩展定义,您必须提供所有者 财产。设置后,此属性为只读且无法更改。

    【讨论】:

    • 感谢您的回答。我尝试从我的应用程序而不是图形资源管理器中执行此操作,并且无需设置属性即可工作(因为它会占用我的应用程序的 appid)。我想问题是图形资源管理器应用程序没有此权限:Directory.AccessAsUser.All
    猜你喜欢
    • 2019-01-26
    • 2012-06-12
    • 1970-01-01
    • 2012-05-28
    • 1970-01-01
    • 2019-02-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多