1.先打开:https://developer.microsoft.com/en-us/graph/graph-explorer
2.用管理员帐号登录。
3.点击”modify permission“,将里面所有权限同意一下。
4.选择POST方法,并把请求地址改为”https://graph.microsoft.com/v1.0/applications/对象 ID/addPassword“
5.复制Azure应用的对象ID。
5.在输入框输入一下内容:
{
"passwordCredential": {
"displayName": "你想要给密钥的描述",
"endDateTime": "9999-12-31T00:00:00Z"
}
}
点击”Run query“,就可以在下面的框里看到如下内容:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#microsoft.graph.passwordCredential",
"customKeyIdentifier": null,
"displayName": "testing",
"endDateTime": "9999-12-31T00:00:00Z",
"hint": "B8A",
"keyId": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"secretText": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"startDateTime": "2023-01-07T08:48:27.8183506Z"
}
其中”secretText“就是密钥了。
Forbidden – 403 – 2481ms. Either the signed-in user does not have sufficient privileges, or you need to consent to one of the permissions on the Modify permissions tab可是我都给了权限了
没事了解决了,感谢