ADFS sso,并使用“ passport-saml Express”“没有用于解密SAML响应的解密密钥”

时间:2019-09-13 12:55:21

标签: node.js encryption adfs passport-saml

登录ADFS SSO时遇到此问题。 “没有用于解密的SAML响应的解密密钥”。 从另一个帐户登录成功。有人可以帮助我。我正在使用Express-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();

1 个答案:

答案 0 :(得分:1)

加密在SAML中的工作方式:身份提供者使用服务提供者的公钥来加密SAML响应的某些元素。服务提供者使用与用于加密的公共密钥相对应的私有密钥进行解密。换句话说,服务提供商需要拥有一个密钥对(私钥和公钥)才能使该用例正常工作。

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

要么取消ADFS一侧的加密,要么将私钥提供给Passport-saml。