[java-idp-oidc] branch main updated: JOIDC-308 - Provide configurable rules for back-channel content fetching

Codeberg noreply at shibboleth.net
Fri Nov 27 17:30: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-idp-oidc.

View the commit online:
https://codeberg.org/Shibboleth/java-idp-oidc/commit/342e460d0fdce8affbff5671a323154a17fa505e

The following commit(s) were added to refs/heads/main by this push:
     new 342e460d JOIDC-308 - Provide configurable rules for back-channel content fetching
342e460d is described below

commit 342e460d0fdce8affbff5671a323154a17fa505e
Author: Henri Mikkonen <henri.mikkonen at iki.fi>
AuthorDate: Fri Nov 27 19:30:28 2026 +0200

    JOIDC-308 - Provide configurable rules for back-channel content fetching
    
    https://shibboleth.atlassian.net/browse/JOIDC-308
    
    - Wire uriValidationCondition to each back-channel call, all defaulting to shibboleth.oidc.DefaultBackChannelUriValidationCondition
      - idp.oidc.httpClient.LogoutUri.uriValidation
      - idp.oidc.httpClient.RequestUri.uriValidation (authorize and par)
      - idp.oidc.httpClient.SectorID.uriValidation
      - idp.oidc.httpClient.RemoteJwkSetCache.uriValidation
    - Wire maxResponseContentLength to the three calls, defaulting to 1048576
      - idp.oidc.httpClient.RequestUri.maxResponseContentLength (authorize and par)
      - idp.oidc.httpClient.SectorID.maxResponseContentLength
      - idp.oidc.httpClient.RemoteJwkSetCache.maxResponseContentLength
    - Also included 2xx status check to sector_identifier_uri fetching
---
 .../impl/ExecuteBackChannelLogoutRequest.java      | 22 ++++++++
 .../impl/SetRequestObjectToResponseContext.java    | 57 +++++++++++++++++++--
 .../op/profile/impl/AddJwksToClientMetadata.java   | 52 +++++++++++++++----
 .../oidc/op/profile/impl/CheckRedirectURIs.java    | 58 +++++++++++++++++++++-
 .../oidc/oidc-logout-propagation-beans.xml         |  3 +-
 .../pushed-authorization-beans.xml                 |  4 +-
 .../idp/flows/oidc/authorize/authorize-beans.xml   |  4 +-
 .../idp/flows/oidc/register/register-beans.xml     |  8 ++-
 .../profile/impl/AddJwksToClientMetadataTest.java  |  1 +
 .../op/profile/impl/CheckRedirectUrisTest.java     |  1 +
 .../net/shibboleth/idp/module/conf/oidc.properties |  2 +
 11 files changed, 193 insertions(+), 19 deletions(-)

diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/logout/profile/impl/ExecuteBackChannelLogoutRequest.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/logout/profile/impl/ExecuteBackChannelLogoutRequest.java
index 6a33dc7f..f12d853c 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/logout/profile/impl/ExecuteBackChannelLogoutRequest.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/logout/profile/impl/ExecuteBackChannelLogoutRequest.java
@@ -55,6 +55,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.function.Function;
+import java.util.function.Predicate;
 
 /**
  * An action that executes the OIDC back-channel logout request and sets the result via
@@ -74,6 +75,9 @@ public class ExecuteBackChannelLogoutRequest extends AbstractOIDCBackChannelLogo
     /** The lookup strategy for back-channel logout endpoint. */
     @Nonnull private final Function<OIDCClientInformation, String> oidcBackChannelLogoutURILookupFunction;
 
+    /** Condition to validate the URI before using it in the HTTP request. */
+    @Nullable private Predicate<URI> uriValidationCondition;
+
     /** The back-channel logout URI for which to send the back-channel logout request. */
     @Nullable private URI backChannelLogoutURI;
 
@@ -106,6 +110,18 @@ public class ExecuteBackChannelLogoutRequest extends AbstractOIDCBackChannelLogo
         httpClientSecurityParameters = params;
     }
 
+    /**
+     * Set the condition to validate the URI before using it in the HTTP request.
+     * 
+     * @param condition the URI validation condition
+     * @since 4.4.0
+     */
+    public void setUriValidationCondition(@Nullable final Predicate<URI> condition) {
+        checkSetterPreconditions();
+
+        uriValidationCondition = condition;
+    }
+
     /** {@inheritDoc} */
     @Override
     protected void doInitialize() throws ComponentInitializationException {
@@ -184,6 +200,12 @@ public class ExecuteBackChannelLogoutRequest extends AbstractOIDCBackChannelLogo
         final LogoutPropagationContext logoutPropContext = getLogoutPropagationContext();
         assert logoutPropContext != null;
 
+        if (uriValidationCondition != null && !uriValidationCondition.test(backChannelLogoutURI)) {
+            log.warn("{} URI validation failed for {}", getLogPrefix(), backChannelLogoutURI);
+            logoutPropContext.setResult(LogoutPropagationContext.Result.Failure);
+            return;
+        }
+
         try (final ClassicHttpResponse response = httpClient.executeOpen(null, httpRequest, httpContext)) {
 
             final String scheme = httpRequest.getUri().getScheme();
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oauth2/profile/impl/SetRequestObjectToResponseContext.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oauth2/profile/impl/SetRequestObjectToResponseContext.java
index 21f5f3ef..497d682a 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oauth2/profile/impl/SetRequestObjectToResponseContext.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/oauth2/profile/impl/SetRequestObjectToResponseContext.java
@@ -17,6 +17,7 @@ package net.shibboleth.idp.plugin.oidc.op.oauth2.profile.impl;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.nio.charset.StandardCharsets;
 import java.text.ParseException;
 import java.util.Map;
 import java.util.Optional;
@@ -32,8 +33,8 @@ import org.apache.hc.client5.http.classic.methods.HttpGet;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
+import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.HttpStatus;
-import org.apache.hc.core5.http.io.entity.EntityUtils;
 import org.opensaml.messaging.context.navigate.ChildContextLookup;
 import org.opensaml.messaging.encoder.AbstractMessageEncoder;
 import org.opensaml.profile.action.ActionSupport;
@@ -57,10 +58,12 @@ import net.shibboleth.idp.plugin.oidc.op.encoding.impl.ResponseUtil;
 import net.shibboleth.idp.plugin.oidc.op.messaging.context.OIDCAuthenticationResponseContext;
 import net.shibboleth.idp.plugin.oidc.op.oauth2.messaging.context.OAuth2PushedAuthorizationRequestContext;
 import net.shibboleth.idp.profile.IdPEventIds;
+import net.shibboleth.oidc.jwk.support.RemoteJwkUtils;
 import net.shibboleth.oidc.metadata.context.OIDCMetadataContext;
 import net.shibboleth.oidc.profile.core.OidcEventIds;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.httpclient.HttpClientSupport;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.LoggerFactory;
 
@@ -96,6 +99,12 @@ public class SetRequestObjectToResponseContext extends AbstractOAuthAuthorizatio
     @Nonnull private Function<ProfileRequestContext, OAuth2PushedAuthorizationRequestContext>
         pushedAuthorizationRequestContextLookupStrategy;
 
+    /** Condition to validate the URI before using it in the HTTP request. */
+    @Nullable private Predicate<URI> uriValidationCondition;
+
+    /** Maximum response content length. */
+    private int maxResponseContentLength;
+
     /** Whether to require pushed authorization request to be used. */
     private boolean requirePushedAuthorization = false;
 
@@ -108,6 +117,7 @@ public class SetRequestObjectToResponseContext extends AbstractOAuthAuthorizatio
                         new InboundMessageContextLookup());
         assert parcls != null;
         pushedAuthorizationRequestContextLookupStrategy = parcls;
+        maxResponseContentLength = RemoteJwkUtils.DEFAULT_MAX_RESPONSE_CONTENT_LENGTH;
     }
 
     /**
@@ -183,6 +193,31 @@ public class SetRequestObjectToResponseContext extends AbstractOAuthAuthorizatio
                 "Pushed authorization request context lookup strategy cannot be null");
     }
 
+    /**
+     * Set the condition to validate the URI before using it in the HTTP request.
+     * 
+     * @param condition the URI validation condition
+     * @since 4.4.0
+     */
+    public void setUriValidationCondition(@Nullable final Predicate<URI> condition) {
+        checkSetterPreconditions();
+
+        uriValidationCondition = condition;
+    }
+
+    /**
+     * Set the maximum response content length.
+     * 
+     * @param maxLength maximum length
+     * @since 4.4.0
+     */
+    public void setMaxResponseContentLength(final int maxLength) {
+        checkSetterPreconditions();
+
+        Constraint.isGreaterThan(0, maxLength, "Maximum response content length must be greater than zero");
+        maxResponseContentLength = maxLength;
+    }
+
     /**
      * Build the {@link HttpClientContext} instance to be used by the HttpClient.
      * 
@@ -334,14 +369,30 @@ public class SetRequestObjectToResponseContext extends AbstractOAuthAuthorizatio
             return;
         }
 
-        final HttpGet httpRequest = new HttpGet(authorizationRequest.getRequestURI());
+        final URI uri = authorizationRequest.getRequestURI();
+        if (uriValidationCondition != null && !uriValidationCondition.test(uri)) {
+            log.warn("{} URI validation failed for {}", getLogPrefix(), uri.toString());
+            oidcResponseContext.setRequestObjectFailure(true);
+            ActionSupport.buildEvent(profileRequestContext, OidcEventIds.INVALID_REQUEST_URI);
+            return;
+        }
+        final HttpGet httpRequest = new HttpGet(uri);
         final HttpClientContext httpContext = buildHttpContext(httpRequest);
         try (final ClassicHttpResponse response = httpClient.executeOpen(null, httpRequest, httpContext)) {
             final String scheme = httpRequest.getUri().getScheme();
             assert scheme != null;
             HttpClientSecuritySupport.checkTLSCredentialEvaluated(httpContext, scheme);
+            if (response == null || response.getEntity() == null) {
+                log.error("{} Could not get the request_uri contents from {}", getLogPrefix(), uri);
+                oidcResponseContext.setRequestObjectFailure(true);
+                ActionSupport.buildEvent(profileRequestContext, OidcEventIds.INVALID_REQUEST_URI);
+                return;
+            }
             if (response.getCode() == HttpStatus.SC_OK) {
-                final String requestObjectValue = EntityUtils.toString(response.getEntity());
+                final HttpEntity responseEntity = response.getEntity();
+                assert responseEntity != null;
+                final String requestObjectValue =
+                        HttpClientSupport.toString(responseEntity, StandardCharsets.UTF_8, maxResponseContentLength);
                 try {
                     final JWT requestObjectByReference = JWTParser.parse(requestObjectValue);
                     assert requestObjectByReference != null;
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/AddJwksToClientMetadata.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/AddJwksToClientMetadata.java
index 340a4932..6a511a41 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/AddJwksToClientMetadata.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/AddJwksToClientMetadata.java
@@ -56,13 +56,20 @@ public class AddJwksToClientMetadata extends AbstractOIDCClientMetadataPopulatio
     
     /** Predicate used to indicate whether contents of remote JWK set should be validated. */
     @Nonnull private Predicate<ProfileRequestContext> validateRemoteJwkSetPredicate;
-    
+
+    /** Condition to validate the URI before using it in the HTTP request. */
+    @Nullable private Predicate<URI> uriValidationCondition;
+
+    /** Maximum response content length. */
+    private int maxResponseContentLength;
+
     /**
      * Constructor.
      */
     public AddJwksToClientMetadata() {
         super();
         validateRemoteJwkSetPredicate = PredicateSupport.alwaysTrue();
+        maxResponseContentLength = RemoteJwkUtils.DEFAULT_MAX_RESPONSE_CONTENT_LENGTH;
     }
     
     /**
@@ -71,8 +78,7 @@ public class AddJwksToClientMetadata extends AbstractOIDCClientMetadataPopulatio
      * @param client client to use
      */
     public void setHttpClient(@Nonnull final HttpClient client) {
-        ifInitializedThrowUnmodifiabledComponentException();
-        ifDestroyedThrowDestroyedComponentException();
+        checkSetterPreconditions();
 
         httpClient = Constraint.isNotNull(client, "HttpClient cannot be null");
     }
@@ -83,8 +89,7 @@ public class AddJwksToClientMetadata extends AbstractOIDCClientMetadataPopulatio
      * @param params the new client security parameters
      */
     public void setHttpClientSecurityParameters(@Nullable final HttpClientSecurityParameters params) {
-        ifInitializedThrowUnmodifiabledComponentException();
-        ifDestroyedThrowDestroyedComponentException();
+        checkSetterPreconditions();
 
         httpClientSecurityParameters = params;
     }
@@ -95,12 +100,36 @@ public class AddJwksToClientMetadata extends AbstractOIDCClientMetadataPopulatio
      * @param predicate the predicate used to indicate whether contents of remote JWK set should be validated.
      */
     public void setValidateRemoteJwkSetPredicate(@Nonnull final Predicate<ProfileRequestContext> predicate) {
-        ifInitializedThrowUnmodifiabledComponentException();
-        ifDestroyedThrowDestroyedComponentException();
+        checkSetterPreconditions();
 
         validateRemoteJwkSetPredicate = Constraint.isNotNull(predicate, "Predicate cannot be null");
     }
-    
+
+    /**
+     * Set the condition to validate the URI before using it in the HTTP request.
+     * 
+     * @param condition the URI validation condition
+     * @since 4.4.0
+     */
+    public void setUriValidationCondition(@Nullable final Predicate<URI> condition) {
+        checkSetterPreconditions();
+
+        uriValidationCondition = condition;
+    }
+
+    /**
+     * Set the maximum response content length.
+     * 
+     * @param maxLength maximum length
+     * @since 4.4.0
+     */
+    public void setMaxResponseContentLength(final int maxLength) {
+        checkSetterPreconditions();
+
+        Constraint.isGreaterThan(0, maxLength, "Maximum response content length must be greater than zero");
+        maxResponseContentLength = maxLength;
+    }
+
     /** {@inheritDoc} */
     public void doInitialize() throws ComponentInitializationException {
         super.doInitialize();
@@ -139,8 +168,13 @@ public class AddJwksToClientMetadata extends AbstractOIDCClientMetadataPopulatio
                 return;
             }
             if (validateRemoteJwkSetPredicate.test(profileRequestContext)) {
+                if (uriValidationCondition != null && !uriValidationCondition.test(jwkUri)) {
+                    log.warn("{} URI validation failed for {}", getLogPrefix(), jwkUri.toString());
+                    ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MESSAGE);
+                    return;
+                }
                 final JWKSet remoteSet = RemoteJwkUtils.fetchRemoteJwkSet(getLogPrefix(), jwkUri, httpClient, 
-                        httpClientSecurityParameters);
+                        httpClientSecurityParameters, maxResponseContentLength);
                 if (containsValidKeys(remoteSet)) {
                     log.debug("{} The jwks_uri endpoint available and contains key(s)", getLogPrefix());
                     getOutputMetadata().setJWKSetURI(jwkUri);
diff --git a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/CheckRedirectURIs.java b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/CheckRedirectURIs.java
index d989b1de..13cd56f2 100644
--- a/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/CheckRedirectURIs.java
+++ b/idp-oidc-extension-impl/src/main/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/CheckRedirectURIs.java
@@ -17,11 +17,13 @@ package net.shibboleth.idp.plugin.oidc.op.profile.impl;
 import java.io.IOException;
 import java.net.URI;
 import java.net.URISyntaxException;
+import java.nio.charset.StandardCharsets;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
 import java.util.function.Function;
+import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import javax.annotation.Nonnull;
@@ -31,8 +33,8 @@ import org.apache.hc.client5.http.classic.HttpClient;
 import org.apache.hc.client5.http.protocol.HttpClientContext;
 import org.apache.hc.core5.http.ClassicHttpRequest;
 import org.apache.hc.core5.http.ClassicHttpResponse;
+import org.apache.hc.core5.http.HttpEntity;
 import org.apache.hc.core5.http.ParseException;
-import org.apache.hc.core5.http.io.entity.EntityUtils;
 import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
 import org.opensaml.profile.action.ActionSupport;
 import org.opensaml.profile.action.EventIds;
@@ -50,10 +52,12 @@ import com.nimbusds.openid.connect.sdk.rp.OIDCClientMetadata;
 
 import net.shibboleth.idp.plugin.oidc.op.messaging.context.navigate.DefaultRequestedMetadataLookupFunction;
 import net.shibboleth.idp.profile.AbstractProfileAction;
+import net.shibboleth.oidc.jwk.support.RemoteJwkUtils;
 import net.shibboleth.oidc.profile.core.OidcEventIds;
 import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
 import net.shibboleth.shared.annotation.constraint.NonnullBeforeExec;
 import net.shibboleth.shared.component.ComponentInitializationException;
+import net.shibboleth.shared.httpclient.HttpClientSupport;
 import net.shibboleth.shared.logic.Constraint;
 import net.shibboleth.shared.primitive.LoggerFactory;
 
@@ -95,6 +99,12 @@ public class CheckRedirectURIs extends AbstractProfileAction {
     /** The default {@link SubjectType} if it was not defined in the request. */
     private SubjectType defaultSubjectType;
 
+    /** Condition to validate the URI before using it in the HTTP request. */
+    @Nullable private Predicate<URI> uriValidationCondition;
+
+    /** Maximum response content length. */
+    private int maxResponseContentLength;
+
     /** Requested metadata to operate on. */
     @NonnullBeforeExec private OIDCClientMetadata metadata;
 
@@ -103,6 +113,7 @@ public class CheckRedirectURIs extends AbstractProfileAction {
         super();
         requestMetadataLookupStrategy = new DefaultRequestedMetadataLookupFunction();
         defaultSubjectType = SubjectType.PUBLIC;
+        maxResponseContentLength = RemoteJwkUtils.DEFAULT_MAX_RESPONSE_CONTENT_LENGTH;
     }
     
     /**
@@ -164,6 +175,31 @@ public class CheckRedirectURIs extends AbstractProfileAction {
         defaultSubjectType = Constraint.isNotNull(subjectType, "The default subjectType cannot be null");
     }
 
+    /**
+     * Set the condition to validate the URI before using it in the HTTP request.
+     * 
+     * @param condition the URI validation condition
+     * @since 4.4.0
+     */
+    public void setUriValidationCondition(@Nullable final Predicate<URI> condition) {
+        checkSetterPreconditions();
+
+        uriValidationCondition = condition;
+    }
+
+    /**
+     * Set the maximum response content length.
+     * 
+     * @param maxLength maximum length
+     * @since 4.4.0
+     */
+    public void setMaxResponseContentLength(final int maxLength) {
+        checkSetterPreconditions();
+
+        Constraint.isGreaterThan(0, maxLength, "Maximum response content length must be greater than zero");
+        maxResponseContentLength = maxLength;
+    }
+
     /** {@inheritDoc} */
     public void doInitialize() throws ComponentInitializationException {
         super.doInitialize();
@@ -217,6 +253,12 @@ public class CheckRedirectURIs extends AbstractProfileAction {
                 ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MESSAGE);
                 return;
             }
+            if (uriValidationCondition != null && !uriValidationCondition.test(sectorIdUri)) {
+                log.warn("{} URI validation failed for {}", getLogPrefix(), sectorIdUri.toString());
+                ActionSupport.buildEvent(profileRequestContext, EventIds.INVALID_MESSAGE);
+                return;
+            }
+
             if (!verifySectorIdUri(sectorIdUri, redirectURIs)) {
                 log.warn("{} All redirect URIs are not found from sector_identifier_uri", getLogPrefix());
                 ActionSupport.buildEvent(profileRequestContext, OidcEventIds.INVALID_REDIRECT_URIS);
@@ -303,7 +345,19 @@ public class CheckRedirectURIs extends AbstractProfileAction {
                 log.error("{} Could not get the sector_identifier_uri contents from {}", getLogPrefix(), sectorIdUri);
                 return false;
             }
-            output = EntityUtils.toString(response.getEntity(), "UTF-8");
+            final int responseCode = response.getCode();
+            if (responseCode < 200 || responseCode > 299) {
+                log.warn("{} Unexpected status code {} in the sector_identifier_uri response from {}", getLogPrefix(),
+                        responseCode, sectorIdUri);
+                return false;
+            }
+
+            final HttpEntity responseEntity = response.getEntity();
+            if (responseEntity == null) {
+                log.error("{} Could not get the sector_identifier_uri contents from {}", getLogPrefix(), sectorIdUri);
+                return false;
+            }
+            output = HttpClientSupport.toString(responseEntity, StandardCharsets.UTF_8, maxResponseContentLength);
         } catch (final URISyntaxException e) {
             log.error("{} Could not get the sector_identifier_uri contents from {}", getLogPrefix(), sectorIdUri, e);
             return false;
diff --git a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/logoutprop/oidc/oidc-logout-propagation-beans.xml b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/logoutprop/oidc/oidc-logout-propagation-beans.xml
index 3bf7d981..d2fb6da9 100644
--- a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/logoutprop/oidc/oidc-logout-propagation-beans.xml
+++ b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/logoutprop/oidc/oidc-logout-propagation-beans.xml
@@ -145,7 +145,8 @@
           class="net.shibboleth.idp.plugin.oidc.op.logout.profile.impl.ExecuteBackChannelLogoutRequest"
           scope="prototype"
           p:httpClient="#{getObject('shibboleth.oidc.NonBrowser.HttpClient') ?: getObject('shibboleth.oidc.DefaultNonBrowser.HttpClient')}"
-          p:httpClientSecurityParameters="#{getObject('shibboleth.oidc.NonBrowser.HttpClientSecurityParameters')}"/>
+          p:httpClientSecurityParameters="#{getObject('shibboleth.oidc.NonBrowser.HttpClientSecurityParameters')}"
+          p:uriValidationCondition="#{getObject('%{idp.oidc.httpClient.LogoutUri.uriValidation:shibboleth.oidc.DefaultBackChannelUriValidationCondition}')}"/>
 
     <bean id="FormOutboundMessage"
           class="net.shibboleth.idp.plugin.oidc.op.logout.profile.impl.FormOutboundLogoutRequestMessage"
diff --git a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth2/pushed-authorization/pushed-authorization-beans.xml b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth2/pushed-authorization/pushed-authorization-beans.xml
index 1da42498..7388ea8f 100644
--- a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth2/pushed-authorization/pushed-authorization-beans.xml
+++ b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oauth2/pushed-authorization/pushed-authorization-beans.xml
@@ -84,7 +84,9 @@
         p:httpClientSecurityParameters="#{getObject('shibboleth.oidc.NonBrowser.HttpClientSecurityParameters')}"
         p:requestObjectEnforcedPredicate-ref="UseRequestObjectPredicate"
         p:pushedAuthorizationRequestEnforcedPredicate-ref="shibboleth.Conditions.FALSE"
-        p:objectMapper-ref="#{'%{idp.oidc.logging.objectMapper:shibboleth.oidc.JSONObjectMapper}'.trim()}" />
+        p:objectMapper-ref="#{'%{idp.oidc.logging.objectMapper:shibboleth.oidc.JSONObjectMapper}'.trim()}"
+        p:maxResponseContentLength="%{idp.oidc.httpClient.RequestUri.maxResponseContentLength:1048576}"
+        p:uriValidationCondition="#{getObject('%{idp.oidc.httpClient.RequestUri.uriValidation:shibboleth.oidc.DefaultBackChannelUriValidationCondition}')}"/>
 
     <bean id="RequestObjectEncryptedCondition" parent="shibboleth.Conditions.Expression"
         c:expression="#input.ensureOutboundMessageContext().ensureSubcontext(T(net.shibboleth.idp.plugin.oidc.op.messaging.context.OIDCAuthenticationResponseContext)).getRequestObject() instanceof T(com.nimbusds.jwt.EncryptedJWT)" />
diff --git a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/authorize/authorize-beans.xml b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/authorize/authorize-beans.xml
index be7075b1..1b84e280 100644
--- a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/authorize/authorize-beans.xml
+++ b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/authorize/authorize-beans.xml
@@ -152,7 +152,9 @@
         p:httpClient="#{getObject('shibboleth.oidc.NonBrowser.HttpClient') ?: getObject('shibboleth.oidc.DefaultNonBrowser.HttpClient')}"
         p:httpClientSecurityParameters="#{getObject('shibboleth.oidc.NonBrowser.HttpClientSecurityParameters')}"
         p:pushedAuthorizationRequestEnforcedPredicate-ref="RequirePushedAuthorizationRequestPredicate"
-        p:objectMapper-ref="#{'%{idp.oidc.logging.objectMapper:shibboleth.oidc.JSONObjectMapper}'.trim()}">
+        p:objectMapper-ref="#{'%{idp.oidc.logging.objectMapper:shibboleth.oidc.JSONObjectMapper}'.trim()}"
+        p:maxResponseContentLength="%{idp.oidc.httpClient.RequestUri.maxResponseContentLength:1048576}"
+        p:uriValidationCondition="#{getObject('%{idp.oidc.httpClient.RequestUri.uriValidation:shibboleth.oidc.DefaultBackChannelUriValidationCondition}')}">
         <property name="requestObjectEnforcedPredicate">
             <bean parent="shibboleth.Conditions.OR">
                 <constructor-arg>
diff --git a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/register/register-beans.xml b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/register/register-beans.xml
index 3d32845a..4fb3a25e 100644
--- a/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/register/register-beans.xml
+++ b/idp-oidc-extension-impl/src/main/resources/META-INF/net/shibboleth/idp/flows/oidc/register/register-beans.xml
@@ -99,7 +99,9 @@
         p:httpClientSecurityParameters="#{getObject('shibboleth.oidc.NonBrowser.HttpClientSecurityParameters')}"
         p:requestMetadataLookupStrategy-ref="shibboleth.oidc.InputMetadataLookupStrategy"
         p:objectMapper-ref="shibboleth.oidc.JSONObjectMapper"
-        p:defaultSubjectType-ref="shibboleth.oidc.DefaultSubjectType" />
+        p:defaultSubjectType-ref="shibboleth.oidc.DefaultSubjectType"
+        p:maxResponseContentLength="%{idp.oidc.httpClient.SectorID.maxResponseContentLength:1048576}"
+        p:uriValidationCondition="#{getObject('%{idp.oidc.httpClient.SectorID.uriValidation:shibboleth.oidc.DefaultBackChannelUriValidationCondition}')}"/>
 
     <bean id="GenerateClientID"
         class="net.shibboleth.idp.plugin.oidc.op.profile.impl.GenerateClientID"
@@ -147,7 +149,9 @@
         p:httpClient="#{getObject('shibboleth.oidc.NonBrowser.HttpClient') ?: getObject('shibboleth.oidc.DefaultNonBrowser.HttpClient')}"
         p:httpClientSecurityParameters="#{getObject('shibboleth.oidc.NonBrowser.HttpClientSecurityParameters')}"
         p:oidcInputMetadataLookupStrategy-ref="shibboleth.oidc.InputMetadataLookupStrategy"
-        p:validateRemoteJwkSetPredicate-ref="%{idp.oidc.dynreg.validateRemoteJwks:shibboleth.Conditions.TRUE}"/>
+        p:validateRemoteJwkSetPredicate-ref="%{idp.oidc.dynreg.validateRemoteJwks:shibboleth.Conditions.TRUE}"
+        p:maxResponseContentLength="%{idp.oidc.httpClient.RemoteJwkSetCache.maxResponseContentLength:1048576}"
+        p:uriValidationCondition="#{getObject('%{idp.oidc.httpClient.RemoteJwkSetCache.uriValidation:shibboleth.oidc.DefaultBackChannelUriValidationCondition}')}"/>
 
     <bean id="StoreClientInformation"
             class="net.shibboleth.idp.plugin.oidc.op.profile.impl.StoreClientInformation" scope="prototype"
diff --git a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/AddJwksToClientMetadataTest.java b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/AddJwksToClientMetadataTest.java
index 8d0b7e10..d5dedd77 100644
--- a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/AddJwksToClientMetadataTest.java
+++ b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/AddJwksToClientMetadataTest.java
@@ -68,6 +68,7 @@ public class AddJwksToClientMetadataTest extends BaseOIDCClientMetadataPopulatio
     @Nonnull protected HttpClient buildMockHttpClient(String contents) throws ClientProtocolException, IOException {
         ClassicHttpResponse mockResponse = Mockito.mock(ClassicHttpResponse.class);
         Mockito.when(mockResponse.getEntity()).thenReturn(new StringEntity(contents));
+        Mockito.when(mockResponse.getCode()).thenReturn(200);
         HttpClient mockClient = Mockito.mock(HttpClient.class);
         Mockito.when(mockClient.executeOpen(Mockito.any(), (ClassicHttpRequest) Mockito.any(),
                 (HttpContext) Mockito.any())).thenReturn(mockResponse);
diff --git a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/CheckRedirectUrisTest.java b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/CheckRedirectUrisTest.java
index 0ea1c6b7..426b2631 100644
--- a/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/CheckRedirectUrisTest.java
+++ b/idp-oidc-extension-impl/src/test/java/net/shibboleth/idp/plugin/oidc/op/profile/impl/CheckRedirectUrisTest.java
@@ -207,6 +207,7 @@ public class CheckRedirectUrisTest extends BaseOIDCRegistrationRequestTest {
             Mockito.when(mockClient.executeOpen(Mockito.any(), (ClassicHttpRequest)Mockito.any(), Mockito.any())).thenThrow(new IOException("mock"));
         } else {
             final ClassicHttpResponse httpResponse = Mockito.mock(ClassicHttpResponse.class);
+            Mockito.when(httpResponse.getCode()).thenReturn(200);
             final HttpEntity httpEntity = Mockito.mock(HttpEntity.class);
             Mockito.when(httpEntity.getContent()).thenReturn(new ByteArrayInputStream(contents.getBytes()));
             Mockito.when(httpResponse.getEntity()).thenReturn(httpEntity);
diff --git a/idp-oidc-extension-impl/src/test/resources/net/shibboleth/idp/module/conf/oidc.properties b/idp-oidc-extension-impl/src/test/resources/net/shibboleth/idp/module/conf/oidc.properties
index 081654ba..820748fb 100644
--- a/idp-oidc-extension-impl/src/test/resources/net/shibboleth/idp/module/conf/oidc.properties
+++ b/idp-oidc-extension-impl/src/test/resources/net/shibboleth/idp/module/conf/oidc.properties
@@ -37,3 +37,5 @@ idp.authn.Password.supportedPrincipals = \
 idp.authn.OAuth2Client.audit.format = %a|%T|%SP|%I|%s|%AF|%CV|%u|%tu|%AR|%UA|%iss|%sub|%exp|%iat|%typ
 
 idp.oidc.logout.requireSessionCondition = shibboleth.Conditions.TRUE
+
+idp.oidc.httpClient.disallowedRanges =
\ No newline at end of file

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


More information about the commits mailing list