【问题标题】:passport-saml integration with idp护照-saml 与 idp 的集成
【发布时间】:2017-02-03 18:46:06
【问题描述】:

我的应用程序需要与 SAML IDP 集成,我使用的是用于 node.js 的 passport-saml,下面是配置

passport.use(new SamlStrategy(
  {
    issuer: 'http://192.168.1.5/assert',
    entryPoint: 'https://wwww.aa.com/webservices/public/saml2sso?SPID=http://192.168.1.5/metadata.xml',

    callbackUrl: 'http://192.168.1.5/assert',
    decryptionPvk:fs.readFileSync(path.resolve(__dirname, '..', 'certs') + "/cert.pem").toString(),
    privateCert: fs.readFileSync(path.resolve(__dirname, '..', 'certs') + "/key.pem").toString(),
    cert: [fs.readFileSync(path.resolve(__dirname, '..', 'certs') + "/dev.cer").toString()],

  },
  function (profile, done) {
    return done(null, profile);
  }
))

我知道证书参数是来自 IDP 的证书(公钥),但 privateCert 和 decryptionPvk 是什么。我将私钥 key.pem 作为 privateCert 并将公钥 (cert.pem) 作为 decryptionPvk 传递,但它不起作用。我使用以下命令生成密钥和证书: openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -nodes -days 900

【问题讨论】:

    标签: passport.js saml passport-saml


    【解决方案1】:

    如果你还没有,你应该看看这个thread

    您只附加了代码的配置部分,但我猜 [authentication callback] (https://www.npmjs.com/package/passport-saml#provide-the-authentication-callback) 部分已正确实现。 至于'cert'属性,我认为你应该根据passport-saml文档示例提供'cert.pem'的内容。

    【讨论】:

      【解决方案2】:

      我认为答案有点晚了,但是在我们将身份验证请求发送到 IdP 之前,这两个选项都用于加密身份验证请求。所以你必须添加你的私钥。

      {decryptionPvk: privateKey, privateCert: privateKey}
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2021-02-16
        • 2016-04-10
        • 2014-08-16
        • 2018-07-11
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多