【发布时间】:2017-12-12 23:34:51
【问题描述】:
我需要通过 MSI 从我的密钥库获取访问令牌。
- 我按照guide 启用 MSI。 MSI 已启用且必要的 扩展程序已安装。
- 我执行此guide 来为我的 VM 添加 Key Vault 的访问控制。 VM 是 KeyVault 的贡献者
- 我尝试根据此guide 获取 AC,并在尝试访问 Key Vault 时得到 403。
详细步骤 3:
curl http://localhost:50342/oauth2/token --data "resource=https://vault.azure.net" -H Metadata:true-
curl https://<YOUR-KEY-VAULT-URL>/secrets/<secret-name>?api-version=2016-10-01 -H "Authorization: Bearer <ACCESS TOKEN>"
当我运行第 2 步时,出现 403 错误。
我尝试将 'https://vault.azure.net' 替换为 'https://' 但又遇到另一个错误:
{"error":"invalid_resource","error_description":"AADSTS50001: The application named https://<YOUR-KEY-VAULT-URL> was not found in the tenant named <A tenant ID>.This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You might have sent your authentication request to the wrong tenant.\r\nTrace ID: 7365f8f5-791f-4131-88f8-9466cadc4d00\r\nCorrelation ID: e18e0e5e-966e-460b-9b61-16decf97dff4\r\nTimestamp: 2017-12-12 11:18:01Z","error_codes":[50001],"timestamp":"2017-12-12 11:18:01Z","trace_id":"7365f8f5-791f-4131-88f8-9466cadc4d00","correlation_id":"e18e0e5e-966e-460b-9b61-16decf97dff4"}
怎么了?
【问题讨论】:
标签: azure azure-keyvault