node.js - 如何解决节点/快递的“PII 被隐藏”
问题描述
我有一个使用 azure 上托管的 express 的 node-api。我使用 Azure AD 进行身份验证。当我尝试使用邮递员进行调试时,我得到这样的错误响应
"message": "IDX10511: Signature validation failed. Keys tried: '[PII is hidden]'. \nkid: '[PII is hidden]'. \nExceptions caught:\n '[PII is hidden]'.\ntoken: '[PII is hidden]'."
错误本身是我可以弄清楚的(希望如此),但我需要能够显示 PII,我该如何管理?
评论后编辑:
好的,所以我会尝试解释。
我有一个使用 msal 和 loginpopup(Authsettings) 的角度前端。
export const OAuthSettings = { appId: '*************', redirectUri: 'http://localhost:4200', authority : "https://login.microsoftonline.com/***tenant***/", scopes: [ "user.read", "openid", "profile", "mailboxsettings.read", "calendars.readwrite" ] };
使用我的企业帐户登录后,我得到了访问令牌。
现在我想调用我的 api,它(应该)受 azure ad 保护。然后我得到错误。显然有些东西没有正确配置。只是不知道要调试什么或如何调试。
解决方案
我以前回答过类似的问题,这通常是由scope
.
您需要公开受 Azure 保护的node-api 应用程序的 api 。然后将其更改scope
为:{your api application client id}/{scope name}
。
export const OAuthSettings = {
appId: '*************',
redirectUri: 'http://localhost:4200',
authority : "https://login.microsoftonline.com/***tenant***/",
scopes: [
"{your api application client id}/user.read"
]
};
推荐阅读
- google-apps-script - 如何使用 Apps 脚本将特定格式的日期从单元格中的 HTML 表单中获取到 Google 电子表格中
- visual-studio-code - 无法在当前工作目录中运行主类
- amazon-web-services - AWS EMR Spark 错误,“无法加载 driverClassName com.mysql.jdbc.Driver 的类”
- javascript - NodeJS - 与承诺的异步 - 没有按预期工作
- flutter - 访问和取消 dart/flutter 中的周期性计时器
- c - curl 替代 InternetReadFile
- python - 将字符串传递给数据框 - For 循环
- sql-server - Azure Resource Mover 和 SQL Server 是否存在丢失数据的风险?
- python - 如何将文本数据转换为 CoNLL 格式
- javascript - 如何在运行时从 Internet 下载 React Native 组件