Skip to content

Make the SamlResponse returned attribute map preserve attribute order#331

Merged
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom
mauromol:preserve-returned-attribute-order
Jun 24, 2021
Merged

Make the SamlResponse returned attribute map preserve attribute order#331
pitbulk merged 1 commit intoSAML-Toolkits:masterfrom
mauromol:preserve-returned-attribute-order

Conversation

@mauromol
Copy link
Copy Markdown
Contributor

The map returned by SamlResposne containing the attributes returned by
the IdP now preserves the order in which such attributes appear in the
SAML response XML. This is not strictly mandatory, but a plus.
Indeed, the test method
com.onelogin.saml2.test.AuthTest.testProcessResponse() was not
deterministic before this change: indeed, the iteration order of HashMap
is undetermined so expecting to see attribute names in a given order
could lead to a test failure. This change also fixes this and attribute
names are expected now to be seen in the order in which the
corresponding attributes appear in the test XML file.

This closes #330.

The map returned by SamlResposne containing the attributes returned by
the IdP now preserves the order in which such attributes appear in the
SAML response XML. This is not strictly mandatory, but a plus.
Indeed, the test method
com.onelogin.saml2.test.AuthTest.testProcessResponse() was not
deterministic before this change: indeed, the iteration order of HashMap
is undetermined so expecting to see attribute names in a given order
could lead to a test failure. This change also fixes this and attribute
names are expected now to be seen in the order in which the
corresponding attributes appear in the test XML file.
@pitbulk pitbulk force-pushed the master branch 3 times, most recently from ab7e4d7 to 3c79c8c Compare May 18, 2021 00:32
@pitbulk pitbulk merged commit 8aaef77 into SAML-Toolkits:master Jun 24, 2021
@mauromol mauromol deleted the preserve-returned-attribute-order branch July 14, 2021 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make SamlResponse.getAttributes() use a LinkedHashMap

2 participants