【发布时间】:2020-07-03 15:27:10
【问题描述】:
我正在尝试在 SustainSys Stub IDP 页面上提交表单数据,作为模拟 SAML 登录而不涉及浏览器的自动化测试套件的一部分。
我正在提交表单数据 POST 请求,但表单所需的重复键似乎没有在表单数据中提交。 请求如下所示:
request({
method: 'POST',
url: 'https://stubidp.sustainsys.com/{id}',
form: true,
body: {
"AssertionModel.AttributeStatements.Index": "0",
"AssertionModel.AttributeStatements[0].Type": "urn:oid:2.5.4.10",
"AssertionModel.AttributeStatements[0].Value": "Test 123",
"AssertionModel.AttributeStatements.Index": "1",
"AssertionModel.AttributeStatements[1].Type": "https://some-url.com",
"AssertionModel.AttributeStatements[1].Value": "001",
"AssertionModel.AttributeStatements.Index": "2",
"AssertionModel.AttributeStatements[2].Type": "https://some-url.com",
"AssertionModel.AttributeStatements[2].Value": "Open",
"AssertionModel.AttributeStatements.Index": "16",
"AssertionModel.AttributeStatements[16].Type": "urn:oid:2.5.4.4",
"AssertionModel.AttributeStatements[16].Value": 'Admin-Smith'
}
})
问题在于"AssertionModel.AttributeStatements.Index" 属性,因为只有最后一个值为16 的属性是由我用于请求的JS 库发送的。因此,返回的 SAML 响应不正确。如何发送这些属性以便端点正确解析它们?
【问题讨论】: