Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make the SamlResponse returned attribute map preserve attribute order #331

Merged

Conversation

mauromol
Copy link
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