diff --git a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/registration/RelyingPartyRegistration.java b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/registration/RelyingPartyRegistration.java index b62e8df79f..f6a14b2325 100644 --- a/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/registration/RelyingPartyRegistration.java +++ b/saml2/saml2-service-provider/src/main/java/org/springframework/security/saml2/provider/service/registration/RelyingPartyRegistration.java @@ -21,7 +21,7 @@ import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.HashSet; +import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Set; @@ -479,7 +479,7 @@ public final class RelyingPartyRegistration { org.springframework.security.saml2.credentials.Saml2X509Credential credential) { PrivateKey privateKey = credential.getPrivateKey(); X509Certificate certificate = credential.getCertificate(); - Set credentialTypes = new HashSet<>(); + Set credentialTypes = new LinkedHashSet<>(); if (credential.isSigningCredential()) { credentialTypes.add(Saml2X509Credential.Saml2X509CredentialType.SIGNING); } @@ -499,7 +499,7 @@ public final class RelyingPartyRegistration { Saml2X509Credential credential) { PrivateKey privateKey = credential.getPrivateKey(); X509Certificate certificate = credential.getCertificate(); - Set credentialTypes = new HashSet<>(); + Set credentialTypes = new LinkedHashSet<>(); if (credential.isSigningCredential()) { credentialTypes.add( org.springframework.security.saml2.credentials.Saml2X509Credential.Saml2X509CredentialType.SIGNING); @@ -724,9 +724,9 @@ public final class RelyingPartyRegistration { private List signingAlgorithms = new ArrayList<>(); - private Collection verificationX509Credentials = new HashSet<>(); + private Collection verificationX509Credentials = new LinkedHashSet<>(); - private Collection encryptionX509Credentials = new HashSet<>(); + private Collection encryptionX509Credentials = new LinkedHashSet<>(); private String singleSignOnServiceLocation; @@ -1034,9 +1034,9 @@ public final class RelyingPartyRegistration { private String entityId = "{baseUrl}/saml2/service-provider-metadata/{registrationId}"; - private Collection signingX509Credentials = new HashSet<>(); + private Collection signingX509Credentials = new LinkedHashSet<>(); - private Collection decryptionX509Credentials = new HashSet<>(); + private Collection decryptionX509Credentials = new LinkedHashSet<>(); private String assertionConsumerServiceLocation = "{baseUrl}/login/saml2/sso/{registrationId}"; @@ -1052,7 +1052,7 @@ public final class RelyingPartyRegistration { private ProviderDetails.Builder providerDetails = new ProviderDetails.Builder(); - private Collection credentials = new HashSet<>(); + private Collection credentials = new LinkedHashSet<>(); private Builder(String registrationId) { this.registrationId = registrationId;