[java-idp-plugin-oidc-rp] branch main updated: Move IdP abstract flows into RP test resources

Phil Smart philip.smart at jisc.ac.uk
Tue Apr 25 10:35:17 UTC 2023


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

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

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-plugin-oidc-rp.git;a=commit;h=66fa348dd4587ddfdf4a55b6933fcc84a6d0a8a6

The following commit(s) were added to refs/heads/main by this push:
     new 66fa348  Move IdP abstract flows into RP test resources
66fa348 is described below

commit 66fa348dd4587ddfdf4a55b6933fcc84a6d0a8a6
Author: Phil Smart <philip.smart at jisc.ac.uk>
AuthorDate: Tue Apr 25 11:35:14 2023 +0100

    Move IdP abstract flows into RP test resources
    
            - So the RP is not reliant on the IdP for the SWF flow tests
---
 idp-oidc-rp-impl/pom.xml                           |  1 -
 .../plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java  |  6 +-
 .../flow-test/flows/authn/authn-abstract-flow.xml  | 98 ++++++++++++++++++++++
 .../flows/authn/conditions/conditions-flow.xml     | 35 ++++++++
 4 files changed, 137 insertions(+), 3 deletions(-)

diff --git a/idp-oidc-rp-impl/pom.xml b/idp-oidc-rp-impl/pom.xml
index 4ecbdcd..18ff63b 100644
--- a/idp-oidc-rp-impl/pom.xml
+++ b/idp-oidc-rp-impl/pom.xml
@@ -19,7 +19,6 @@
     </properties>
 
     <dependencies>
-
         <!-- compile time intra project dependencies -->
         <dependency>
             <groupId>net.shibboleth.idp.plugin.authn</groupId>
diff --git a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java
index 5c5cdbb..fb18fb6 100644
--- a/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java
+++ b/idp-oidc-rp-impl/src/test/java/net/shibboleth/idp/plugin/authn/oidc/rp/impl/OIDCRPFlowTest.java
@@ -186,11 +186,13 @@ public class OIDCRPFlowTest extends AbstractAuthnXmlFlowExecutionTests {
     /** 
      * Map of flow resources that support building the flow to test.
      * These are only for parent flows, not subflows.
+     * 
+     * <p>Note, these are all local to the RP, as copied from the IdP. These might need updating in the futre.</p>
      */
     @Nonnull @NonnullElements @Unmodifiable protected final Map<String,String> flowResources = 
             Map.of(
-            "classpath:/net/shibboleth/idp/flows/authn/authn-abstract-flow.xml","authn.abstract",
-            "classpath:/flows/authn/conditions/conditions-flow.xml","authn/conditions",
+            "classpath:flow-test/flows/authn/authn-abstract-flow.xml","authn.abstract",
+            "classpath:flow-test/flows/authn/conditions/conditions-flow.xml","authn/conditions",
             "classpath:/conf/authn/authn-events-flow.xml","authn.events");
 
 
diff --git a/idp-oidc-rp-impl/src/test/resources/flow-test/flows/authn/authn-abstract-flow.xml b/idp-oidc-rp-impl/src/test/resources/flow-test/flows/authn/authn-abstract-flow.xml
new file mode 100644
index 0000000..a03550c
--- /dev/null
+++ b/idp-oidc-rp-impl/src/test/resources/flow-test/flows/authn/authn-abstract-flow.xml
@@ -0,0 +1,98 @@
+<flow xmlns="http://www.springframework.org/schema/webflow"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow.xsd"
+      abstract="true" parent="authn.events">
+
+    <!-- Rudimentary impediment to direct execution of subflow. -->
+    <input name="calledAsSubflow" type="boolean" required="true" />
+
+    <!-- Indicates another login flow has called one as a subflow. -->
+    <input name="calledAsExtendedFlow" type="boolean" />
+
+    <!-- Defines the possible end-state events, and a global transition rule. -->
+
+    <!-- Successful completion of subflow. -->
+    <end-state id="proceed" />
+
+    <!-- Error events to reflect back from this subflow. -->
+    <end-state id="AccountError" />
+    <end-state id="AccountLocked" />
+    <end-state id="AuthenticationException" />
+    <end-state id="IdentitySwitch" />
+    <end-state id="InputOutputError" />
+    <end-state id="InvalidCredentials" />
+    <end-state id="InvalidEvent" />
+    <end-state id="InvalidProfileContext" />
+    <end-state id="InvalidProfileConfiguration" />
+    <end-state id="InvalidRelyingPartyConfiguration" />
+    <end-state id="InvalidRelyingPartyContext" />
+    <end-state id="InvalidSubject" />
+    <end-state id="InvalidSubjectContext" />
+    <end-state id="InvalidSubjectCanonicalizationContext" />
+    <end-state id="NoCredentials" />
+    <end-state id="NoPassive" />
+    <end-state id="NoPotentialFlow" />
+    <end-state id="ProxyCountExceeded" />
+    <end-state id="RequestUnsupported" />
+    <end-state id="ReselectFlow" />
+    <end-state id="RestartAuthentication" />
+    <end-state id="RuntimeException" />
+    <end-state id="SubjectCanonicalizationError" />
+    <end-state id="InvalidCSRFToken" />
+
+    <!-- Support for discovery implemented via child flow branch to DoDiscovery action. -->
+    <decision-state id="DoDiscovery">
+        <if test="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.authn.context.AuthenticationContext)).getAttemptedFlow().isDiscoveryRequired() and opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.authn.context.AuthenticationContext)).getAuthenticatingAuthority() == null"
+            then="CallDiscovery"
+            else="PostDiscovery" />
+    </decision-state>
+    
+    <subflow-state id="CallDiscovery" subflow="authn/Discovery">
+        <input name="calledAsSubflow" value="true" />
+        <transition on="proceed" to="PostDiscovery" />
+    </subflow-state>
+  
+    <action-state id="LogRuntimeException">
+        <on-entry>
+            <evaluate expression="LogRuntimeException.log('net.shibboleth.idp.authn', flowExecutionException)" />
+        </on-entry>
+        <evaluate expression="'RuntimeException'" />
+        
+        <transition to="RuntimeException" />
+    </action-state>
+
+    <global-transitions>
+    	<transition on-exception="net.shibboleth.idp.ui.csrf.InvalidCSRFTokenException" to="InvalidCSRFToken" />
+        <transition on-exception="java.lang.RuntimeException" to="LogRuntimeException" />
+        <transition on="#{currentEvent.id.startsWith('authn/')}" to="ReselectFlow">
+            <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.authn.context.AuthenticationContext)).setSignaledFlowId(currentEvent.id)" />
+        </transition>        
+  		<transition on="InvalidCSRFToken" to="InvalidCSRFToken" />
+        <transition on="AccountError" to="AccountError" />
+        <transition on="AccountLocked" to="AccountLocked" />
+        <transition on="AuthenticationException" to="AuthenticationException" />
+        <transition on="IdentitySwitch" to="IdentitySwitch" />
+        <transition on="InputOutputError" to="InputOutputError" />
+        <transition on="InvalidCredentials" to="InvalidCredentials" />
+        <transition on="InvalidProfileContext" to="InvalidProfileContext" />
+        <transition on="InvalidProfileConfiguration" to="InvalidProfileConfiguration" />
+        <transition on="InvalidRelyingPartyConfiguration" to="InvalidRelyingPartyConfiguration" />
+        <transition on="InvalidRelyingPartyContext" to="InvalidRelyingPartyContext" />
+        <transition on="InvalidSubject" to="InvalidSubject" />
+        <transition on="InvalidSubjectContext" to="InvalidSubjectContext" />
+        <transition on="InvalidSubjectCanonicalizationContext" to="InvalidSubjectCanonicalizationContext" />
+        <transition on="NoCredentials" to="NoCredentials" />
+        <transition on="NoPassive" to="NoPassive" />
+        <transition on="NoPotentialFlow" to="NoPotentialFlow" />
+        <transition on="ProxyCountExceeded" to="ProxyCountExceeded" />
+        <transition on="RequestUnsupported" to="RequestUnsupported" />
+        <transition on="ReselectFlow" to="ReselectFlow" />
+        <transition on="RestartAuthentication" to="RestartAuthentication" />
+        <transition on="RuntimeException" to="RuntimeException" />
+        <transition on="SubjectCanonicalizationError" to="SubjectCanonicalizationError" />
+    </global-transitions>
+
+    <!-- Do not load the beans for tests, these are not needed -->
+   <!--  <bean-import resource="flow-test/flows/authn/authn-abstract-beans.xml" /> -->
+
+</flow>
diff --git a/idp-oidc-rp-impl/src/test/resources/flow-test/flows/authn/conditions/conditions-flow.xml b/idp-oidc-rp-impl/src/test/resources/flow-test/flows/authn/conditions/conditions-flow.xml
new file mode 100644
index 0000000..53c4994
--- /dev/null
+++ b/idp-oidc-rp-impl/src/test/resources/flow-test/flows/authn/conditions/conditions-flow.xml
@@ -0,0 +1,35 @@
+<flow xmlns="http://www.springframework.org/schema/webflow"
+      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+      xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow.xsd"
+      abstract="true">
+
+    <!-- Rudimentary impediment to direct execution of subflow. -->
+    <input name="calledAsSubflow" type="boolean" required="true" />
+
+    <action-state id="ValidateUsernamePassword">
+        
+        <!-- Call outs for exceptional conditions. -->
+        <transition on="AccountWarning" to="CallExpiringPassword" />
+        <transition on="ExpiringPassword" to="CallExpiringPassword" />
+        <transition on="ExpiredPassword" to="CallExpiredPassword" />
+        <transition on="AccountLocked" to="CallAccountLocked" />
+        
+        <transition to="DisplayUsernamePasswordPage" />
+    </action-state>
+
+    <subflow-state id="CallExpiringPassword" subflow="authn/conditions/expiring-password">
+        <input name="calledAsSubflow" value="true" />
+        <transition on="proceed" to="ContinueSuccessfulAuthentication" />
+    </subflow-state>
+
+    <subflow-state id="CallExpiredPassword" subflow="authn/conditions/expired-password">
+        <input name="calledAsSubflow" value="true" />
+        <transition on="proceed" to="DisplayUsernamePasswordPage" />
+    </subflow-state>
+
+    <subflow-state id="CallAccountLocked" subflow="authn/conditions/account-locked">
+        <input name="calledAsSubflow" value="true" />
+        <transition on="proceed" to="DisplayUsernamePasswordPage" />
+    </subflow-state>
+
+</flow>

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


More information about the commits mailing list