python - 从azure Rest api上传证书失败

标签 python azure rest sdk microsoft-graph-api

问题陈述:

续订在 Azure AD 下注册的应用程序中的证书。

问题:

我在从 MS Graph API 发送补丁时遇到问题> 应用程序 - PATCH 更新应用程序属性。

问题是每当我尝试更改 KeyCredentials 并上传时都会失败,并显示键值不能为 null 或空。现在,当我通过 GET 检索应用程序属性详细信息检查其他证书时,它们为空。我无法理解这个键值是什么,因为我尝试使用 OpenSSL 在本地读取我的证书,但找不到任何这样的值。

任何人都可以在 RestAPI 中帮助我,或者是否有任何 SDK 可以帮助上传证书。

问候

最佳答案

问题是每当我尝试更改 KeyCredentials 并上传它时 失败,键值不能为 null 或为空。

Ans: The Key Credential requires a value to be uploaded in key , otherwise it will fail.

现在,当我从 GET 检索中检查其他证书时 应用程序属性详细信息,它们为空。

Ans: It by default shows the secure string values as null when you do a select then only you can find out the secure string values. enter image description here

我无法理解这个键值是什么,因为我尝试使用 OpenSSL 在本地读取我的证书,但找不到任何此类值。

Ans: When you open the .cer file in wordpad it will show you something like :

-----BEGIN CERTIFICATE-----
<<sensitive_values>>
-----END CERTIFICATE-----

Basically the sensitive value can be used for the value of key .

但是假设我还想要完整的字段和 key ,我必须提供 select= 中的所有字段...是否有其他方法来处理此问题?

Ans: There is no other way to get the values , except for selecting all the required fields you need.

有什么方法可以上传文件,而不是读取数据并发出补丁请求吗?

Ans: Unfortunately No, As of now there is no direct way to upload a cert file instead of reading it and then uploading it.

关于python - 从azure Rest api上传证书失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69618811/

相关文章:

c# - 不使用自定义域名时加载 Azure 证书

azure - 如何更改虚拟机的凭据

rest - 使用 REST API 在 Node.js 中进行 Amazon S3 分段上传

java - 简单的休息

rest - Elasticsearch XML文件内容

python - 列表推导式中定义的变量是否会泄漏到封闭范围中?

python - 在 return 语句中进行 for 循环

python - 尝试编写几行代码来创建主日期查找表

python - Django : how to define a unique slug for an abstract model and its children?

asp.net - Asp网络核心和SPA(VUE): The SPA default page middleware could not return the default page '/index.html'