I am trying to submit the form data on SustainSys Stub IDP page as part of automation test suite that is simulating SAML login without involving the browser.
I am submitting the form data POST request but it appears that the duplicate keys required by the form are not being submitted in the form data. Request looks like this:
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'
}
})
The issue is with the "AssertionModel.AttributeStatements.Index"
properties as only the last one with value 16
is being sent by the JS Library I am using for the request. As a result the SAML response being returned isn't correct. How can these properties be sent so they are parsed correctly by the endpoint?
Looks like "AssertionModel.AttributeStatements.Index"
properties are not actually required. the request works without these.