我在记录 ADFS SSO 时遇到此问题。 “加密的 SAML 响应没有解密 key ”。 从另一个帐户登录成功。有人可以帮我解决这个问题。我正在使用 Express 进行 Passport-saml 工作。
这是我陷入困境的代码快照。
node_modules/passport-saml/lib/passport-saml/saml.js 为空。位于第 623:15 行
if (encryptedAssertions.length == 1) {
if (!self.options.decryptionPvk)
throw new Error('No decryption key for encrypted SAML response');
var encryptedAssertionXml = encryptedAssertions[0].toString();
最佳答案
加密在 SAML 中的工作原理:身份提供商使用服务提供商的公钥对 SAML 响应的某些元素进行加密。服务提供商使用与用于加密的公钥相对应的私钥进行解密。换句话说,服务提供商需要拥有一个 key 对(私钥和公钥)才能使该用例发挥作用。
上述 key 对的私钥需要通过passport-saml中的decryptionPvk
参数进行配置。由于断言已加密,但在 decryptionPvk
中找不到私钥,passport-saml 会提示。
删除 ADFS 端的加密或向 Passport-saml 提供私钥。
关于node.js - ADFS sso 并使用 Passport-saml Express "No decryption key for encrypted SAML response",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57924059/