ADFS sso 和使用 Passport-saml Express“加密 SAML 响应没有解密密钥”

Sur*_*har 1 encryption adfs node.js passport-saml

我在记录 ADFS SSO 时遇到此问题。“加密的 SAML 响应没有解密密钥”。从另一个帐户登录成功。有人可以帮我解决这个问题。我正在使用 Express 进行 Passport-saml 工作。

这是我陷入困境的代码快照。

node_modules/passport-saml/lib/passport-saml/saml.js 为 null。在第 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();
Run Code Online (Sandbox Code Playgroud)

ide*_*ral 7

SAML 中加密的工作原理:身份提供商使用服务提供商的公钥对 SAML 响应的某些元素进行加密。服务提供商使用与用于加密的公钥相对应的私钥进行解密。换句话说,服务提供商需要拥有密钥对(私钥和公钥)才能使该用例发挥作用。

上述密钥对的私钥需要通过decryptionPvkpassport-saml中的参数进行配置。由于断言已加密,但在 中找不到私钥decryptionPvk,passport-saml 会抱怨。

删除 ADFS 端的加密或向 Passport-saml 提供私钥。