首页 > 解决方案 > 如何在 SAML POST 中通过 X509 证书

问题描述

我正在将我们现有的 SAML 实现从 SimpleSAMLphp 迁移到 passport-saml。在使用 HTTP-POST 绑定时,我遇到了一些障碍。

使用 SAML chrome 检查器时,我注意到工作实现通过了消息正文中的 X509 证书,但 passport-saml 似乎没有包含它,只有 SignatureValue。

我的 SAML 策略目前看起来像这样。

const strategy = new passportSaml.Strategy(
  {
    callbackUrl: 'http://localhost:3000/assert',
    entryPoint: 'https://clientsaml.com/samljct/',
    passReqToCallback: true,
    cert: fs.readFileSync(
      path.resolve(__dirname, '../certs/cert.crt'),
      'utf-8'
    ),
    privateKey: fs.readFileSync(
      path.resolve(__dirname, '../certs/privateKey.pem'),
      'utf-8'
    ),
    authnRequestBinding: 'HTTP-POST',
    skipRequestCompression: true
  },
  (profile, done) => {
    console.log(profile);
    return done(null, profile);
  }
);

标签: node.jssamlpassport-saml

解决方案


推荐阅读