[java-plugin-shibd-oidc] branch main updated: Improve testing granularity and consistency

Phil Smart philip.smart at jisc.ac.uk
Wed Oct 15 14:44:53 UTC 2025


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

philsmart pushed a commit to branch main
in repository java-plugin-shibd-oidc.

View the commit online:
http://git.shibboleth.net/view/?p=java-plugin-shibd-oidc.git;a=commit;h=f1f924582abf6c490d434946305def10fe5a254b

The following commit(s) were added to refs/heads/main by this push:
     new f1f9245  Improve testing granularity and consistency
f1f9245 is described below

commit f1f924582abf6c490d434946305def10fe5a254b
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Wed Oct 15 15:44:50 2025 +0100

    Improve testing granularity and consistency
    
     - Add specific profiles for with and without a request object
---
 .../logic/RequestObjectRequiredAndSupported.java   |  2 +-
 .../sp/oidc/flows/OIDCAuthenticationFlowTest.java  | 26 +++++++++-------------
 .../idp/module/conf/sp/oidc-test-agents.xml        | 15 +++++++++----
 3 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/sp-oidc-api/src/main/java/net/shibboleth/sp/oidc/config/logic/RequestObjectRequiredAndSupported.java b/sp-oidc-api/src/main/java/net/shibboleth/sp/oidc/config/logic/RequestObjectRequiredAndSupported.java
index 9ea19de..1e4bec2 100644
--- a/sp-oidc-api/src/main/java/net/shibboleth/sp/oidc/config/logic/RequestObjectRequiredAndSupported.java
+++ b/sp-oidc-api/src/main/java/net/shibboleth/sp/oidc/config/logic/RequestObjectRequiredAndSupported.java
@@ -93,7 +93,7 @@ public class RequestObjectRequiredAndSupported extends AbstractRelyingPartyPredi
         log.debug("Authentication RequestObject was enabled '{}', is supported by the OP '{}', "
                 + "will be used '{}'", requestObjectRequestedFromConfig, isSupportedByOP, requestedAndSupport);
        
-        return true;//requestedAndSupport;
+        return requestedAndSupport;
 
     }
 
diff --git a/sp-oidc-conf-impl/src/test/java/net/shibboleth/sp/oidc/flows/OIDCAuthenticationFlowTest.java b/sp-oidc-conf-impl/src/test/java/net/shibboleth/sp/oidc/flows/OIDCAuthenticationFlowTest.java
index f8621b9..e8b7b8b 100644
--- a/sp-oidc-conf-impl/src/test/java/net/shibboleth/sp/oidc/flows/OIDCAuthenticationFlowTest.java
+++ b/sp-oidc-conf-impl/src/test/java/net/shibboleth/sp/oidc/flows/OIDCAuthenticationFlowTest.java
@@ -53,10 +53,6 @@ import net.shibboleth.sp.profile.InitiatorConstants;
 import net.shibboleth.sp.profile.SPConstants;
 import net.shibboleth.sp.profile.impl.IssueCorrelationCookie;
 
-/**
- * TODO these tests work using a signed request object atm, we need to formalise that being set, and
- * test using without the request object.
- */
 @ContextConfiguration(
         locations = {
                 "classpath:/net/shibboleth/sp/oidc-test-beans.xml", },
@@ -96,7 +92,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         input.addmember(RemotedHttpServletRequest.STRUCTURE_NAME).structure();        
         input.addmember(InitiatorConstants.RESPONSE_URL).string(RESPONSE_URL);
         input.addmember(SPConstants.TARGET).unsafe_string(RESOURCE_URL);       
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -119,7 +115,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         input.addmember(InitiatorConstants.RESPONSE_URL).string(RESPONSE_URL);
         input.addmember(SPConstants.TARGET).unsafe_string(RESOURCE_URL); 
         input.addmember(OIDCInitiatorConstants.FORCE_AUTHN).integer(1);
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -144,7 +140,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         input.addmember(InitiatorConstants.RESPONSE_URL).string(RESPONSE_URL);
         input.addmember(SPConstants.TARGET).unsafe_string(RESOURCE_URL); 
         input.addmember(OIDCInitiatorConstants.MAX_AGE).longinteger(60l);
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -168,7 +164,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         input.addmember(InitiatorConstants.RESPONSE_URL).string(RESPONSE_URL);
         input.addmember(SPConstants.TARGET).unsafe_string(RESOURCE_URL); 
         input.addmember(OIDCInitiatorConstants.PROMPT).string("none");
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -195,7 +191,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         aclist.add(new DDF(null).string("loa1"));
         aclist.add(new DDF(null).string("loa2"));
         
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -207,7 +203,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
     
     /**
      * Basic flow test with requested claims from the RP config. The RP config is set onto
-     * the application test-oidc-application-with-requested-attrs.
+     * the application test-oidc-application-with-ro-with-requested-attrs.
      * 
      * @throws Exception on error
      */
@@ -219,7 +215,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         input.addmember(RemotedHttpServletRequest.STRUCTURE_NAME).structure();        
         input.addmember(InitiatorConstants.RESPONSE_URL).string(RESPONSE_URL);
         input.addmember(SPConstants.TARGET).unsafe_string(RESOURCE_URL);        
-        setApplicationRequest("test-oidc-application-with-requested-attrs", input);
+        setApplicationRequest("test-oidc-application-with-ro-with-requested-attrs", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -246,7 +242,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         resourceList.add(new DDF(null).string("https://cal.example.com"));
         resourceList.add(new DDF(null).string("https://mail.example.com"));
         
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -272,7 +268,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         input.addmember(InitiatorConstants.RESPONSE_URL).string(RESPONSE_URL);
         input.addmember(SPConstants.TARGET).unsafe_string(RESOURCE_URL); 
         input.addmember(OIDCInitiatorConstants.SCOPE).string("email profile");
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -296,7 +292,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         input.addmember(InitiatorConstants.RESPONSE_URL).string(RESPONSE_URL);
         input.addmember(SPConstants.TARGET).unsafe_string(RESOURCE_URL); 
         input.addmember(OIDCInitiatorConstants.UI_LOCALES).string("fr-CA fr en");
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
@@ -321,7 +317,7 @@ public class OIDCAuthenticationFlowTest extends AbstractSPFlowTest {
         input.addmember(InitiatorConstants.RESPONSE_URL).string(RESPONSE_URL);
         input.addmember(SPConstants.TARGET).unsafe_string(RESOURCE_URL); 
         input.addmember(OIDCInitiatorConstants.DISPLAY).string("page");
-        setApplicationRequest("test-oidc-application", input);
+        setApplicationRequest("test-oidc-application-with-ro", input);
 
         final FlowExecutionResult result = flowExecutor.launchExecution(FLOW_ID, null, externalContext);
         assertFlowExecutionResult(result, FLOW_ID);
diff --git a/sp-oidc-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/oidc-test-agents.xml b/sp-oidc-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/oidc-test-agents.xml
index 3bdc8d5..993c6c1 100644
--- a/sp-oidc-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/oidc-test-agents.xml
+++ b/sp-oidc-conf-impl/src/test/resources/net/shibboleth/idp/module/conf/sp/oidc-test-agents.xml
@@ -22,11 +22,14 @@
         p:issuer="https://testsp.example.org">
         <property name="applications">
             <set>
-                <bean p:id="test-oidc-application" parent="shibboleth.sp.Application"
+                <bean p:id="test-oidc-application-without-ro" parent="shibboleth.sp.Application"
                     p:profileConfigurations-ref="test.ProfileConfigurations" 
                     p:metadataResolver-ref="shibboleth.ProviderMetadataResolverService"/>
+                <bean p:id="test-oidc-application-with-ro" parent="shibboleth.sp.Application"
+                    p:profileConfigurations-ref="test.RequestObjectProfileConfigurations" 
+                    p:metadataResolver-ref="shibboleth.ProviderMetadataResolverService"/>
                 <bean p:id="test-oidc-application-with-requested-attrs" parent="shibboleth.sp.Application"
-                    p:profileConfigurations-ref="test.ProfileConfigurations" 
+                    p:profileConfigurations-ref="test.RequestedClaimsProfileConfigurations" 
                     p:metadataResolver-ref="shibboleth.ProviderMetadataResolverService"/>
             </set>
         </property>
@@ -36,10 +39,14 @@
     </util:list>
 
     <util:list id="test.ProfileConfigurations">
-        <bean parent="OIDC.SSO" p:securityConfiguration-ref="testSecConfig"/>
+        <bean parent="OIDC.SSO" p:securityConfiguration-ref="testSecConfig" p:useRequestObject="false"/>
     </util:list>
     
-    <util:list id="test.ProfileConfigurations">
+    <util:list id="test.RequestObjectProfileConfigurations">
+        <bean parent="OIDC.SSO" p:securityConfiguration-ref="testSecConfig" p:useRequestObject="true" p:signRequestObject="true" p:encryptRequestObject="false"/>
+    </util:list>
+    
+    <util:list id="test.RequestedClaimsProfileConfigurations">
         <bean parent="OIDC.SSO" p:securityConfiguration-ref="testSecConfig">
             <property name="requestedClaimsLookupStrategy">
                 <bean id="basicRequestedClaims" class="net.shibboleth.sp.oidc.functions.RequestedClaimsExampleFunction"/>

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


More information about the commits mailing list