我们正在尝试按照此处所述创建application resource type
: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
资源
{
"customKeyIdentifier": "binary",
"endDate": "String (timestamp)",
"keyId": "guid",
"startDate": "String (timestamp)",
"value": "string"
}
但是,我们可以创建一个指定了空PasswordCredential的应用程序 - 是的应用程序已创建,我们在应用程序列表中看到它(https://apps.dev.microsoft.com/#/appList),但我们还是需要知道它的凭据。
有没有办法以编程方式创建一个提供凭据的APP?
答案 0 :(得分:4)
passwordCredentials
的正确架构:
[{
"customKeyIdentifier": "binary",
"endDateTime": "String (timestamp)",
"keyId": "guid",
"startDateTime": "String (timestamp)",
"secretText": "string"
}...]
secretText
是应用密码的新属性名称,不再使用"value"
。
我最终只使用了两个道具:
{
"endDateTime": "2020-10-19T17:59:59.53Z",
"secretText": "should be 16-64 characters long"
}
我现在要做一个拉动请求来改变他们的文档
BTW,这是一个资源的完整模式,帮助我找到它:https://graph.microsoft.com/beta/$metadata#applications/$entity