[java-oidfed-common] 02/02: Improvements to the resolve entity flow

Codeberg noreply at shibboleth.net
Thu Oct 8 15:22:49 UTC 2026


This is an automated email from the git hooks/post-receive script.

codeberg pushed a commit to branch main
in repository java-oidfed-common.

View the commit online:
https://codeberg.org/Shibboleth/java-oidfed-common/commit/ac353dc6381ca335bf92270cebf9462c44ae81bb

commit ac353dc6381ca335bf92270cebf9462c44ae81bb
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Thu Oct 8 18:22:29 2026 +0300

    Improvements to the resolve entity flow
    
    - The order of entity_types does not matter (use Set)
    - Improve parsing the federation_resolve_endpoint URI (incl. https-scheme)
---
 .../decoding/impl/ResolveEntityRequestDecoder.java |  5 +--
 .../messaging/impl/ResolveEntityRequest.java       | 21 +++++------
 .../ResolveEntityCacheContainerIdentifier.java     | 21 +++++------
 .../profile/impl/BuildResolveEntityResponse.java   |  7 ++--
 .../oidfed/profile/impl/CallResolveEntityApi.java  | 41 ++++++++++++++++++----
 .../navigate/DefaultEntityTypesLookupFunction.java |  8 ++---
 .../messaging/impl/ResolveEntityRequestTest.java   | 24 +++++++++----
 7 files changed, 85 insertions(+), 42 deletions(-)

diff --git a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/decoding/impl/ResolveEntityRequestDecoder.java b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/decoding/impl/ResolveEntityRequestDecoder.java
index 0926036..d87dd44 100644
--- a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/decoding/impl/ResolveEntityRequestDecoder.java
+++ b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/decoding/impl/ResolveEntityRequestDecoder.java
@@ -36,6 +36,7 @@ import com.nimbusds.oauth2.sdk.http.JakartaServletUtils;
 import jakarta.servlet.http.HttpServletRequest;
 import net.shibboleth.oidfed.messaging.impl.ResolveEntityRequest;
 import net.shibboleth.shared.primitive.LoggerFactory;
+import net.shibboleth.shared.primitive.StringSupport;
 
 /**
  * Message decoder decoding OpenID Federation Resolve Entity request {@link ResolveEntityRequest}.
@@ -79,10 +80,10 @@ public class ResolveEntityRequestDecoder extends AbstractHttpServletRequestMessa
             final String subject = Optional.ofNullable(parameters.get("sub"))
                     .filter(Objects::nonNull)
                     .filter(list -> list.size() == 1)
-                    .map(list -> list.get(0))
+                    .map(list -> StringSupport.trimOrNull(list.get(0)))
                     .orElse(null);
             if (subject == null) {
-                throw new MessageDecodingException("No single sub value in the request");
+                throw new MessageDecodingException("No single non-empty sub value in the request");
             }
             final List<String> trustAnchors = Optional.ofNullable(parameters.get("trust_anchor"))
                     .filter(Objects::nonNull)
diff --git a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/messaging/impl/ResolveEntityRequest.java b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/messaging/impl/ResolveEntityRequest.java
index d9f8fd4..b776b00 100644
--- a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/messaging/impl/ResolveEntityRequest.java
+++ b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/messaging/impl/ResolveEntityRequest.java
@@ -15,9 +15,11 @@
 package net.shibboleth.oidfed.messaging.impl;
 
 import java.net.URI;
+import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
 import java.util.Set;
+import java.util.TreeSet;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -43,7 +45,7 @@ public class ResolveEntityRequest extends AbstractOptionallyAuthenticatedRequest
     @Nonnull @NotEmpty private final List<String> trustAnchors;
 
     /** The requested entity types to resolve. */
-    @Nonnull private final List<String> entityTypes;
+    @Nonnull private final Set<String> entityTypes;
 
     /**
      * 
@@ -58,13 +60,13 @@ public class ResolveEntityRequest extends AbstractOptionallyAuthenticatedRequest
     public ResolveEntityRequest(@Nonnull final URI uri,
                   @Nonnull @NotEmpty final String sub,
                   @Nonnull @NotEmpty final List<String> anchors,
-                  @Nullable final List<String>  types,
+                  @Nullable final Collection<String>  types,
                   @Nullable final ClientAuthentication clientAuthentication) {
         super(Constraint.isNotNull(uri, "Endpoint URI cannot be null"), clientAuthentication);
-        subject = Constraint.isNotNull(sub, "Subject cannot be empty");
+        subject = Constraint.isNotEmpty(sub, "Subject cannot be empty");
         Constraint.isNotEmpty(anchors, "Trust anchors cannot be empty");
-        trustAnchors = anchors;
-        entityTypes = types == null ? CollectionSupport.emptyList() : CollectionSupport.copyToList(types);
+        trustAnchors = CollectionSupport.copyToList(anchors);
+        entityTypes = types == null ? CollectionSupport.emptySet() : CollectionSupport.copyToSet(types);
     }
 
     /**
@@ -90,7 +92,7 @@ public class ResolveEntityRequest extends AbstractOptionallyAuthenticatedRequest
      *
      * @return The entity type to resolve.
      */
-    @Nonnull public List<String> getEntityTypes() {
+    @Nonnull public Set<String> getEntityTypes() {
         return entityTypes;
     }
 
@@ -114,7 +116,7 @@ public class ResolveEntityRequest extends AbstractOptionallyAuthenticatedRequest
         return MoreObjects.toStringHelper(this)
                 .add("subject", getSubject())
                 .add("trustAnchors", getTrustAnchors())
-                .add("entityTypes", getEntityTypes())
+                .add("entityTypes", new TreeSet<>(getEntityTypes()))
                 .add("endpointURI", getEndpointURI())
                 .add("clientAuthentication", getClientAuthentication())
                 .toString();
@@ -123,7 +125,7 @@ public class ResolveEntityRequest extends AbstractOptionallyAuthenticatedRequest
     /** {@inheritDoc} */
     @Override
     public int hashCode() {
-        return Objects.hash(subject, Set.copyOf(trustAnchors), Set.copyOf(entityTypes), getEndpointURI(),
+        return Objects.hash(subject, trustAnchors, entityTypes, getEndpointURI(),
                 getClientAuthentication() != null ? getClientAuthentication().getMethod() : null,
                 getClientAuthentication() != null ? getClientAuthentication().getClientID() : null);
     }
@@ -142,8 +144,7 @@ public class ResolveEntityRequest extends AbstractOptionallyAuthenticatedRequest
         }
         final ResolveEntityRequest other = (ResolveEntityRequest) obj;
         return getEndpointURI().equals(other.getEndpointURI()) && subject.equals(other.subject) &&
-                entityTypes.containsAll(other.entityTypes) && other.entityTypes.containsAll(entityTypes) &&
-                trustAnchors.containsAll(other.trustAnchors) && other.trustAnchors.containsAll(trustAnchors) &&
+                entityTypes.equals(other.entityTypes) && trustAnchors.equals(other.trustAnchors) &&
                 (getClientAuthentication() == null ? other.getClientAuthentication() == null :
                     other.getClientAuthentication() != null &&
                     getClientAuthentication().getMethod().equals(other.getClientAuthentication().getMethod()) &&
diff --git a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/metadata/cache/resolver/ResolveEntityCacheContainerIdentifier.java b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/metadata/cache/resolver/ResolveEntityCacheContainerIdentifier.java
index f27116f..70bb11a 100644
--- a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/metadata/cache/resolver/ResolveEntityCacheContainerIdentifier.java
+++ b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/metadata/cache/resolver/ResolveEntityCacheContainerIdentifier.java
@@ -15,8 +15,10 @@
 package net.shibboleth.oidfed.metadata.cache.resolver;
 
 import java.io.Serializable;
+import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
+import java.util.Set;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -45,7 +47,7 @@ public class ResolveEntityCacheContainerIdentifier implements Serializable {
     @Nonnull @NotEmpty private final List<String> trustAnchors;
 
     /** The requested entity types to resolve. */
-    @Nonnull private final List<String> entityTypes;
+    @Nonnull private final Set<String> entityTypes;
 
     /**
      * 
@@ -59,12 +61,12 @@ public class ResolveEntityCacheContainerIdentifier implements Serializable {
     public ResolveEntityCacheContainerIdentifier(@Nonnull final String uri,
                   @Nonnull @NotEmpty final String sub,
                   @Nonnull @NotEmpty final List<String> anchors,
-                  @Nullable final List<String>  types) {
+                  @Nullable final Collection<String> types) {
         endpoint = Constraint.isNotEmpty(uri, "Endpoint URI cannot be null");
-        subject = Constraint.isNotNull(sub, "Subject cannot be empty");
+        subject = Constraint.isNotEmpty(sub, "Subject cannot be empty");
         Constraint.isNotEmpty(anchors, "Trust anchors cannot be empty");
-        trustAnchors = anchors;
-        entityTypes = types == null ? CollectionSupport.emptyList() : CollectionSupport.copyToList(types);
+        trustAnchors = CollectionSupport.copyToList(anchors);
+        entityTypes = types == null ? CollectionSupport.emptySet() : CollectionSupport.copyToSet(types);
     }
 
     /**
@@ -86,11 +88,11 @@ public class ResolveEntityCacheContainerIdentifier implements Serializable {
     }
 
     /**
-     * Returns the requested entity type to resolve.
+     * Returns the requested entity types to resolve.
      *
-     * @return The entity type to resolve.
+     * @return The entity types to resolve.
      */
-    @Nonnull public List<String> getEntityTypes() {
+    @Nonnull public Set<String> getEntityTypes() {
         return entityTypes;
     }
 
@@ -135,8 +137,7 @@ public class ResolveEntityCacheContainerIdentifier implements Serializable {
         }
         final ResolveEntityCacheContainerIdentifier other = (ResolveEntityCacheContainerIdentifier) obj;
         return endpoint.equals(other.endpoint) && subject.equals(other.subject)
-                && trustAnchors.containsAll(other.trustAnchors) && other.trustAnchors.containsAll(trustAnchors)
-                && entityTypes.containsAll(other.entityTypes) && other.entityTypes.containsAll(entityTypes);
+                && trustAnchors.equals(other.trustAnchors) && entityTypes.equals(other.entityTypes);
 
     }
 
diff --git a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/impl/BuildResolveEntityResponse.java b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/impl/BuildResolveEntityResponse.java
index c543ed8..b885a14 100644
--- a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/impl/BuildResolveEntityResponse.java
+++ b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/impl/BuildResolveEntityResponse.java
@@ -20,6 +20,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.Set;
 import java.util.function.Function;
 import java.util.stream.Collectors;
 
@@ -60,7 +61,7 @@ public class BuildResolveEntityResponse extends AbstractBuildEntityStatementActi
     @Nonnull private Function<ProfileRequestContext, RelyingPartyTrustChainContext> trustChainContextLookupStrategy;
 
     /** Strategy used to lookup the entity types included in the response metadata. */
-    @Nonnull private Function<ProfileRequestContext, List<String>> entityTypesLookupStrategy;
+    @Nonnull private Function<ProfileRequestContext, Set<String>> entityTypesLookupStrategy;
 
     /** Trust chain context to operate on. */
     @NonnullBeforeExec private RelyingPartyTrustChainContext trustChainContext;
@@ -92,7 +93,7 @@ public class BuildResolveEntityResponse extends AbstractBuildEntityStatementActi
      * 
      * @param strategy lookup strategy
      */
-    public void setEntityTypesLookupStrategy(@Nonnull final Function<ProfileRequestContext, List<String>> strategy) {
+    public void setEntityTypesLookupStrategy(@Nonnull final Function<ProfileRequestContext, Set<String>> strategy) {
         checkSetterPreconditions();
         entityTypesLookupStrategy = Constraint.isNotNull(strategy, "EntityTypesLookupStrategy cannot be null");
     }
@@ -125,7 +126,7 @@ public class BuildResolveEntityResponse extends AbstractBuildEntityStatementActi
             return false;                                    
         }
         final Metadata metadata = selectedTrustChain.getMetadata();
-        final List<String> entityTypes = entityTypesLookupStrategy.apply(profileRequestContext);
+        final Set<String> entityTypes = entityTypesLookupStrategy.apply(profileRequestContext);
         log.trace("{} The following entity types were requested: {}", getLogPrefix(), entityTypes);
         if (entityTypes != null && !entityTypes.isEmpty()) {
             final Map<String,Object> filteredMetadata = metadata.getAllClaims().entrySet()
diff --git a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/impl/CallResolveEntityApi.java b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/impl/CallResolveEntityApi.java
index f929ead..df2fa5e 100644
--- a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/impl/CallResolveEntityApi.java
+++ b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/impl/CallResolveEntityApi.java
@@ -27,6 +27,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Objects;
 import java.util.Optional;
+import java.util.Set;
 import java.util.function.Function;
 import java.util.function.Predicate;
 import java.util.stream.Collectors;
@@ -122,7 +123,7 @@ public class CallResolveEntityApi extends AbstractProfileAction {
     private Function<ProfileRequestContext, List<TrustedRemoteResolverEntity>> trustedEntitiesLookupStrategy;
 
     /** Strategy used to fetch the entity types used in the resolve entity request. */
-    @Nonnull private Function<ProfileRequestContext, List<String>> entityTypesLookupStrategy;
+    @Nonnull private Function<ProfileRequestContext, Set<String>> entityTypesLookupStrategy;
 
     /** Lookup function to supply cached response lifetime. */
     @Nonnull private Function<ProfileRequestContext,Duration> cachedResponseLifetimeLookupStrategy;
@@ -148,7 +149,7 @@ public class CallResolveEntityApi extends AbstractProfileAction {
         trustChainIDsLookupStrategy = new DefaultTrustChainIDsLookupStrategy();
         entityConfigurationLookupStrategy = FunctionSupport.constant(null);
         requireEntityConfigurationCondition = PredicateSupport.alwaysFalse();
-        entityTypesLookupStrategy = FunctionSupport.constant(List.of("openid_relying_party"));
+        entityTypesLookupStrategy = FunctionSupport.constant(Set.of("openid_relying_party"));
         cachedResponseLifetimeLookupStrategy = FunctionSupport.constant(Duration.ofMinutes(5));
     }
 
@@ -258,7 +259,7 @@ public class CallResolveEntityApi extends AbstractProfileAction {
      * 
      * @param strategy lookup strategy
      */
-    public void setEntityTypesLookupStrategy(@Nonnull final Function<ProfileRequestContext, List<String>> strategy) {
+    public void setEntityTypesLookupStrategy(@Nonnull final Function<ProfileRequestContext, Set<String>> strategy) {
         checkSetterPreconditions();
         entityTypesLookupStrategy = Constraint.isNotNull(strategy, "EntityTypesLookupStrategy cannot be null");
     }
@@ -410,13 +411,13 @@ public class CallResolveEntityApi extends AbstractProfileAction {
                 log.warn("{} Could not resolve entity configuration for {}", getLogPrefix(), trustedEntity);
                 continue;
             }
-            final URI uri = Optional.of(configuration.getParsedPayload().getMetadata())
+            final URI uri = Optional.ofNullable(configuration.getParsedPayload().getMetadata())
                         .map(metadata -> metadata.getFederationEntityMetadata())
                         .map(entityMetadata -> entityMetadata.get("federation_resolve_endpoint"))
-                        .map(endpoint -> URI.create((String) endpoint))
+                        .map(endpoint -> parseHttpsUri(endpoint, trustedEntity))
                         .orElse(null);
             if (uri == null) {
-                log.warn("{} Could not fetch federation resolve endpoint for {}", getLogPrefix(), trustedEntity);
+                log.debug("{} Could not fetch federation resolve endpoint for {}", getLogPrefix(), trustedEntity);
                 continue;
             }
             final String uriValue = uri.toString();
@@ -551,4 +552,32 @@ public class CallResolveEntityApi extends AbstractProfileAction {
         return null;
     }
 
+    /**
+     * Parses an https-schemed URI from the given raw value of federation_resolve_endpoint.
+     * 
+     * @param endpoint the raw endpoint value
+     * @param trustedEntity the trusted entity used for logging
+     * @return the https-schemed URI, or null if it could not be parsed
+     */
+    @Nullable private URI parseHttpsUri(@Nullable final Object endpoint,
+            @Nonnull final TrustedRemoteResolverEntity trustedEntity) {
+        if (endpoint instanceof String string) {
+            try {
+                final URI uri = URI.create(string);
+                if (!"https".equalsIgnoreCase(uri.getScheme())) {
+                    log.warn("{} Ignoring non-https federation_resolve_endpoint {} of {}", getLogPrefix(), endpoint,
+                            trustedEntity);
+                } else {
+                    return uri;
+                }
+            } catch (final IllegalArgumentException e) {
+                log.warn("{} Could not parse an URI from federation_resolve_endpoint {} of {}", getLogPrefix(),
+                        endpoint, trustedEntity);
+            }
+        } else {
+            log.warn("{} Could not parse a string from federation_resolve_endpoint {} of {}", getLogPrefix(),
+                    endpoint, trustedEntity);
+        }
+        return null;
+    }
 }
\ No newline at end of file
diff --git a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/navigate/DefaultEntityTypesLookupFunction.java b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/navigate/DefaultEntityTypesLookupFunction.java
index 9866b5b..536ecf6 100644
--- a/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/navigate/DefaultEntityTypesLookupFunction.java
+++ b/oidfed-common-impl/src/main/java/net/shibboleth/oidfed/profile/navigate/DefaultEntityTypesLookupFunction.java
@@ -14,8 +14,8 @@
 
 package net.shibboleth.oidfed.profile.navigate;
 
-import java.util.List;
 import java.util.Optional;
+import java.util.Set;
 import java.util.function.Function;
 
 import javax.annotation.Nullable;
@@ -29,18 +29,18 @@ import net.shibboleth.shared.primitive.NonnullSupplier;
 /**
  * Default function to lookup entity types to be included to the response metadata.
  */
-public class DefaultEntityTypesLookupFunction implements Function<ProfileRequestContext, List<String>> {
+public class DefaultEntityTypesLookupFunction implements Function<ProfileRequestContext, Set<String>> {
 
     /** {@inheritDoc} */
     @Override @Nullable
-    public List<String> apply(@Nullable final ProfileRequestContext profileRequestContext) {
+    public Set<String> apply(@Nullable final ProfileRequestContext profileRequestContext) {
         return Optional.ofNullable(profileRequestContext)
                 .map(prc -> prc.getInboundMessageContext())
                 .map(msgCtx -> msgCtx.getMessage())
                 .filter(ResolveEntityRequest.class::isInstance)
                 .map(ResolveEntityRequest.class::cast)
                 .map(req -> req.getEntityTypes())
-                .orElseGet(NonnullSupplier.of(CollectionSupport.emptyList()));
+                .orElseGet(NonnullSupplier.of(CollectionSupport.emptySet()));
     }
 
 }
diff --git a/oidfed-common-impl/src/test/java/net/shibboleth/oidfed/messaging/impl/ResolveEntityRequestTest.java b/oidfed-common-impl/src/test/java/net/shibboleth/oidfed/messaging/impl/ResolveEntityRequestTest.java
index c65c0e5..21b7935 100644
--- a/oidfed-common-impl/src/test/java/net/shibboleth/oidfed/messaging/impl/ResolveEntityRequestTest.java
+++ b/oidfed-common-impl/src/test/java/net/shibboleth/oidfed/messaging/impl/ResolveEntityRequestTest.java
@@ -61,16 +61,21 @@ public class ResolveEntityRequestTest {
         Assert.assertTrue(request.equals(defaultRequest(null)));
         Assert.assertTrue(defaultRequest(null).equals(request));
         Assert.assertTrue(request.equals(
-                request(endpoint1, sub, List.of(anchor2, anchor1), List.of("openid_provider", "openid_relying_party"),
+                request(endpoint1, sub, List.of(anchor1, anchor2), List.of("openid_provider", "openid_relying_party"),
                         null)));
-        Assert.assertTrue(request(endpoint1, sub, List.of(anchor2, anchor1),
+        Assert.assertTrue(request(endpoint1, sub, List.of(anchor1, anchor2),
                 List.of("openid_provider", "openid_relying_party"), null).equals(request));
+        Assert.assertTrue(request.equals(
+                request(endpoint1, sub, List.of(anchor1, anchor2), List.of("openid_relying_party", "openid_provider"),
+                        null)));
+        Assert.assertTrue(request(endpoint1, sub, List.of(anchor1, anchor2),
+                List.of("openid_relying_party", "openid_provider"), null).equals(request));
         Assert.assertFalse(request.equals(
                 request(endpoint1, sub, List.of(anchor2), List.of("openid_provider", "openid_relying_party"), null)));
         Assert.assertFalse(request(endpoint1, sub, List.of(anchor2),
                 List.of("openid_provider", "openid_relying_party"), null).equals(request));
         Assert.assertFalse(request.equals(
-                request(endpoint1, sub, List.of(anchor2, anchor1), List.of("openid_relying_party"), null)));
+                request(endpoint1, sub, List.of(anchor1, anchor2), List.of("openid_relying_party"), null)));
         Assert.assertFalse(request(endpoint1, sub, List.of(anchor2, anchor1),
                 List.of("openid_relying_party"), null).equals(request));
         Assert.assertFalse(request.equals(request(endpoint1, sub, List.of(anchor2, anchor1), null, null)));
@@ -92,7 +97,7 @@ public class ResolveEntityRequestTest {
         final ResolveEntityRequest request = defaultRequest(null);
         Assert.assertEquals(request.hashCode(), request.hashCode());
         Assert.assertEquals(request.hashCode(), defaultRequest(null).hashCode());
-        Assert.assertEquals(request.hashCode(), request(endpoint1, sub, List.of(anchor2, anchor1),
+        Assert.assertEquals(request.hashCode(), request(endpoint1, sub, List.of(anchor1, anchor2),
                 List.of("openid_provider", "openid_relying_party"), null).hashCode());
         Assert.assertNotEquals(request.hashCode(), request(endpoint2, sub, List.of(anchor2, anchor1),
                 List.of("openid_provider", "openid_relying_party"), null).hashCode());
@@ -115,7 +120,9 @@ public class ResolveEntityRequestTest {
         Assert.assertFalse(defaultRequest(null).equals(request));
         Assert.assertEquals(request, defaultRequest(secretAuth));
         Assert.assertEquals(defaultRequest(secretAuth), request);
-        Assert.assertTrue(request(endpoint1, sub, List.of(anchor2, anchor1),
+        Assert.assertTrue(request(endpoint1, sub, List.of(anchor1, anchor2),
+                List.of("openid_provider", "openid_relying_party"), secretAuth).equals(request));
+        Assert.assertFalse(request(endpoint1, sub, List.of(anchor2, anchor1),
                 List.of("openid_provider", "openid_relying_party"), secretAuth).equals(request));
         Assert.assertFalse(request.equals(
                 request(endpoint1, sub, List.of(anchor2), List.of("openid_provider", "openid_relying_party"),
@@ -145,7 +152,10 @@ public class ResolveEntityRequestTest {
                 List.of("openid_provider", "openid_relying_party"), new ClientSecretPost(new ClientID(client1),
                         new Secret("mockSecret"))).equals(request));
         // secret is checked by the authentication earlier in the process
-        Assert.assertTrue(request(endpoint1, sub, List.of(anchor2, anchor1),
+        Assert.assertTrue(request(endpoint1, sub, List.of(anchor1, anchor2),
+                List.of("openid_provider", "openid_relying_party"), new ClientSecretBasic(new ClientID(client1),
+                        new Secret("wrongSecret"))).equals(request));
+        Assert.assertFalse(request(endpoint1, sub, List.of(anchor2, anchor1),
                 List.of("openid_provider", "openid_relying_party"), new ClientSecretBasic(new ClientID(client1),
                         new Secret("wrongSecret"))).equals(request));
     }
@@ -157,7 +167,7 @@ public class ResolveEntityRequestTest {
         final ResolveEntityRequest request = defaultRequest(secretAuth);
         Assert.assertEquals(request.hashCode(), request.hashCode());
         Assert.assertEquals(request.hashCode(), defaultRequest(secretAuth).hashCode());
-        Assert.assertEquals(request.hashCode(), request(endpoint1, sub, List.of(anchor2, anchor1),
+        Assert.assertEquals(request.hashCode(), request(endpoint1, sub, List.of(anchor1, anchor2),
                 List.of("openid_provider", "openid_relying_party"), secretAuth).hashCode());
         Assert.assertNotEquals(request.hashCode(), request(endpoint2, sub, List.of(anchor2, anchor1),
                 List.of("openid_provider", "openid_relying_party"), secretAuth).hashCode());

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list