SAML中的InResponseTo值是什么? (错误:响应中缺少InResponseTo。)

问题描述 投票:0回答:1

我正在构建一个启用Salesforce SSO的服务器。登录应用程序并收到回调时,出现此错误

错误:响应中缺少InResponseTo在SAML.validateInResponseTo(/node_modules/passport-saml/lib/passport-saml/saml.js:746:13)在/node_modules/passport-saml/lib/passport-saml/saml.js:602:19在Promise.apply(/node_modules/q/q.js:1185:26)在Promise.promise.promiseDispatch(/node_modules/q/q.js:808:41)在/node_modules/q/q.js:1411:14在runSingle(/node_modules/q/q.js:137:13)在刷新时(/node_modules/q/q.js:125:13)在processTicksAndRejections(internal / process / task_queues.js:75:11)

我的privateCert错误吗?还是我应该在saml策略中设置任何内容?我不确定错误是从哪里来的。我该如何解决..?

// Certificates
// Private key to use for SSL -----BEGIN PRIVATE KEY----
var privateKey  = fs.readFileSync(__dirname + '/../certs/server.key', 'utf8');
// Public x509 certificate to use ------BEGIN CERTIFICATE-----
var certificate = fs.readFileSync(__dirname + '/../certs/server.crt', 'utf8');
// Aloha SSO Metadata
var idpCert = fs.readFileSync(__dirname + '/../certs/idp_cert.pem', 'utf8');

var samlStrategy = new saml.Strategy({
    entryPoint: 'https://aloha.my.salesforce.com/idp/loginpp=0aaaaasdasdB',
    issuer: 'urn:myapp',
    identifierFormat: null,
    decryptionPvk: privateKey, //.key version
    // validateInResponseTo: true, <- I tried this with FALSE AS WELL.
    disableRequestedAuthnContext: false,
    cert: idpCert, //Aloha (IDP) metadata // provide it with single line if there is any error
}, function(profile, done) {
    return done(null, profile);
});

passport.use('samlStrategy', samlStrategy);

非常感谢

node.js ssl passport.js passport-saml
1个回答
0
投票

错误:InResponseTo在以下情况下发生:

  1. SAML响应包含一个InResponseTo值,该值与SAML请求的值不匹配。
  2. InResponseTo值将​​在“我的域”页面加载并在8分钟后过期后立即生成。因此,如果在加载“我的域”页面之后8分钟以上将SAML响应发送到Salesforce,则会返回此错误。
© www.soinside.com 2019 - 2024. All rights reserved.