简体   繁体   English

天蓝色无法访问密钥库以发布可验证的凭据

[英]azure unable to access keyvault for issuing verifiable credentials

I'm trying to use Azure's sample code for issuing and verifying Verifiable Credentials in Nodejs.我正在尝试使用 Azure 的示例代码在 Nodejs 中发布和验证可验证凭据。 I've followed the tutorial , and manage to setup a Verifiable Credential preview, as in the example.我已按照教程进行操作,并设法设置了可验证的凭据预览,如示例中所示。 But when I run the run.sh script and I scan the generated qr code in my microsoft-authenticator app I get the following exception in my app:但是当我运行run.sh脚本并在我的 microsoft-authenticator 应用程序中扫描生成的二维码时,我的应用程序中出现以下异常:

INFO/DID_SDK/: HttpError: 403 body: {"requestId":"myRequestId", "date":"currentDate", "mscv":"myMscv", "error":{"code":"Forbidden", "message":"Unable to access Keyvault resource with given credentials."}} INFO/DID_SDK/: HttpError: 403 body: {"requestId":"myRequestId", "date":"currentDate", "mscv":"myMscv", "error":{"code":"Forbidden", "message ":"无法使用给定凭据访问 Keyvault 资源。"}}

The error 403 forbidden usually occurs if you don't have required permissions to access the requested resource (in your case Key Vault).如果您没有访问请求的资源(在您的情况下为 Key Vault)所需的权限,通常会发生错误403 forbidden

Please check whether you have set access policies for the Key Vault before setting up verifiable credentials.在设置可验证凭据之前,请检查您是否为 Key Vault 设置了访问策略 If not, set it like below:如果没有,请按如下方式设置:

Go to Azure portal -> Go to key vault settings -> Access policies -> Add access policies -> User -> Select account -> Add key permissions.转到 Azure 门户 -> 转到密钥保管库设置 -> 访问策略 -> 添加访问策略 -> 用户 -> 选择帐户 -> 添加密钥权限。

![图片

You should not modify the keys and secrets once created.一旦创建,您不应修改密钥和机密。 Modifying keys and secrets will invalidate credentials.修改密钥和秘密将使凭据无效。 Check this Microsoft Article .检查这篇微软文章

Make sure to set access policies in your key vault for both the administrator account of the Azure AD Verifiable Credentials service and for the Request Service API principal that you created.确保在密钥保管库中为Azure AD 可验证凭据服务管理员帐户和你创建的请求服务 API 主体设置访问策略。

There is also a possibility to get this error if firewall policy is enabled.如果启用了防火墙策略,也有可能出现此错误。

Turn on Azure Key Vault logging that will give you the reason behind the error ( Access policy/Firewall policy ).打开Azure Key Vault 日志记录,这将为您提供错误背后的原因(访问策略/防火墙策略)。

Based on the reason, you can troubleshoot by following the below reference :根据原因,您可以按照以下参考进行故障排除:

HTTP 403: Troubleshooting - Azure Key Vault | HTTP 403:故障排除-Azure Key Vault | Microsoft Docs 微软文档

AZIdentity | AZ身份 | Key Vault Firewall access by Azure App Services Azure 应用服务的 Key Vault 防火墙访问

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM