gpt4 book ai didi

azure-active-directory - Microsoft Graph API - 创建应用程序(测试版)

转载 作者:行者123 更新时间:2023-12-04 16:46:36 29 4
gpt4 key购买 nike

我们正在尝试创建应用程序资源类型,如下所述:https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/api-reference/beta/resources/application.md

请求:

POST https://graph.microsoft.com/beta/applications

{
"displayName": "MyCoolApp",
"passwordCredentials": [{
"customKeyIdentifier":"ObJix/HDVU+3+hH5RmA+dw==",
"endDateTime":"2018-10-19T17:59:59.6521653Z",
"keyId":"ed087fba-0068-431f-98d7-e6b74dedd931",
"startDateTime":"2016-10-19T17:59:59.6521653Z",
"value":"somepass"
}]
}

结果是:

{
"error": {
"code": "Request_BadRequest",
"message": "The property 'value' does not exist on type 'Microsoft.DirectoryServices.PasswordCredential'. Make sure to only use property names that are defined by the type.",
"innerError": {
"request-id": "038aa3bd-2b99-4329-a2ae-bc11d2f64609",
"date": "2018-02-04T14:23:57"
}
}
}

为什么 value 不存在?这是 passwordCredentials 资源的 JSON 表示

{
"customKeyIdentifier": "binary",
"endDate": "String (timestamp)",
"keyId": "guid",
"startDate": "String (timestamp)",
"value": "string"
}

它在这里:https://github.com/microsoftgraph/microsoft-graph-docs/blob/master/api-reference/beta/resources/passwordcredential.md

但是,我们可以创建一个指定了空 PasswordCredential 的应用程序 - 是的,应用程序已创建并且我们在应用程序列表 (https://apps.dev.microsoft.com/#/appList) 中看到它,但无论如何我们都需要知道它的凭据。

有没有什么方法可以通过提供的凭据以编程方式创建应用程序?

最佳答案

好的伙计们,我已经弄明白了。该文档显然已过时,因此目前 passwordCredentials 的正确架构:

[{
"customKeyIdentifier": "binary",
"endDateTime": "String (timestamp)",
"keyId": "guid",
"startDateTime": "String (timestamp)",
"secretText": "string"
}...]

secretText 是您应用程序密码的新属性名称,不要再使用 "value"

我最终只使用了 2 个 Prop :

{
"endDateTime": "2020-10-19T17:59:59.53Z",
"secretText": "should be 16-64 characters long"
}

我现在要做一个拉取请求来更改他们的文档

顺便说一句,这里是帮助我找到它的资源的完整架构:https://graph.microsoft.com/beta/$metadata#applications/$entity

关于azure-active-directory - Microsoft Graph API - 创建应用程序(测试版),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48609570/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com