Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.security.cert.X509Certificate;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand Down Expand Up @@ -572,7 +573,7 @@ public String getNameIdSPNameQualifier() throws Exception {
*
*/
public HashMap<String, List<String>> getAttributes() throws XPathExpressionException, ValidationError {
HashMap<String, List<String>> attributes = new HashMap<String, List<String>>();
HashMap<String, List<String>> attributes = new LinkedHashMap<String, List<String>>();

NodeList nodes = this.queryAssertion("/saml:AttributeStatement/saml:Attribute");

Expand Down
2 changes: 1 addition & 1 deletion toolkit/src/main/java/com/onelogin/saml2/Auth.java
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public class Auth {
/**
* User attributes data.
*/
private Map<String, List<String>> attributes = new HashMap<String, List<String>>();
private Map<String, List<String>> attributes = new LinkedHashMap<String, List<String>>();

/**
* If user is authenticated.
Expand Down
5 changes: 3 additions & 2 deletions toolkit/src/test/java/com/onelogin/saml2/test/AuthTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import java.security.cert.CertificateException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -524,7 +525,7 @@ public void testProcessResponse() throws Exception {
when(request.getParameterMap()).thenReturn(singletonMap("SAMLResponse", new String[]{samlResponseEncoded}));
Auth auth2 = new Auth(settings, request, response);

HashMap<String, List<String>> expectedAttributes = new HashMap<String, List<String>>();
HashMap<String, List<String>> expectedAttributes = new LinkedHashMap<String, List<String>>();
List<String> attrValues = new ArrayList<String>();
attrValues.add("smartin");
List<String> attrValues2 = new ArrayList<String>();
Expand All @@ -538,9 +539,9 @@ public void testProcessResponse() throws Exception {
attrValues5.add("Martin2");
expectedAttributes.put("uid", attrValues);
expectedAttributes.put("mail", attrValues2);
expectedAttributes.put("eduPersonAffiliation", attrValues3);
expectedAttributes.put("cn", attrValues4);
expectedAttributes.put("sn", attrValues5);
expectedAttributes.put("eduPersonAffiliation", attrValues3);
List<String> keys = new ArrayList<String>(expectedAttributes.keySet());

assertFalse(auth2.isAuthenticated());
Expand Down