[java-idp-integration-tests] branch main updated: JOIDC-147 - Work on OP plugin Conformance Suite logout tests

Tom Zeller tzeller at dragonacea.biz
Fri Sep 13 11:49:56 UTC 2024


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

tzeller pushed a commit to branch main
in repository java-idp-integration-tests.

View the commit online:
http://git.shibboleth.net/view/?p=java-idp-integration-tests.git;a=commit;h=08820adeb8a415ff4e7de0e0baaba1b32c5430bb

The following commit(s) were added to refs/heads/main by this push:
     new 08820ad  JOIDC-147 - Work on OP plugin Conformance Suite logout tests
08820ad is described below

commit 08820adeb8a415ff4e7de0e0baaba1b32c5430bb
Author: Tom Zeller <tzeller at dragonacea.biz>
AuthorDate: Thu Sep 12 20:16:16 2024 -0500

    JOIDC-147 - Work on OP plugin Conformance Suite logout tests
    
    Logout test does not work yet - no such flow exception.
    
    https://shibboleth.atlassian.net/browse/JOIDC-147
---
 .../idp/integration/tests/oidc/BaseOPTest.java     |  1 +
 .../integration/tests/oidc/OPConformanceTest.java  | 97 ++++++++++++++++++++++
 2 files changed, 98 insertions(+)

diff --git a/src/test/java/net/shibboleth/idp/integration/tests/oidc/BaseOPTest.java b/src/test/java/net/shibboleth/idp/integration/tests/oidc/BaseOPTest.java
index 409ae0b..e5eeb37 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/oidc/BaseOPTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/oidc/BaseOPTest.java
@@ -360,6 +360,7 @@ public abstract class BaseOPTest extends BaseIntegrationTest {
         addToDefault.append("<ref bean=\"OAUTH2.Token\" />\n");
         addToDefault.append("<ref bean=\"OAUTH2.Revocation\" />\n");
         addToDefault.append("<ref bean=\"OAUTH2.Introspection\" />\n");
+        addToDefault.append("<ref bean=\"OIDC.Logout\" />\n");
 
         replaceFile(pathToRelyingPartyXML, defaultRPText, defaultRPText + "\n" + addToDefault.toString());
     }
diff --git a/src/test/java/net/shibboleth/idp/integration/tests/oidc/OPConformanceTest.java b/src/test/java/net/shibboleth/idp/integration/tests/oidc/OPConformanceTest.java
index 738a1de..735c3bf 100644
--- a/src/test/java/net/shibboleth/idp/integration/tests/oidc/OPConformanceTest.java
+++ b/src/test/java/net/shibboleth/idp/integration/tests/oidc/OPConformanceTest.java
@@ -133,6 +133,79 @@ public class OPConformanceTest extends BaseOPTest {
         replaceIdPHomeFile(pathToOpenIDConfiguration, oldText, newText);
     }
 
+    /**
+     * Set up logout view for conformance tests.
+     * 
+     * @throws IOException
+     *             if an error occurs
+     */
+    protected void setUpLogoutView() throws IOException {
+
+        final Path pathToLogoutVm = Paths.get("views", "logout.vm");
+
+        final String oldText1 = "<meta http-equiv=\"refresh\" content=\"10;url=\\$flowExecutionUrl&_eventId=local\">\n";
+
+        final String newText1 = "<!-- begin added for OIDC RP-initiated logout -->\n" + //
+                                "        #elseif (\\$postLogoutRedirectUri)\n" + //
+                                "            <meta http-equiv=\"refresh\" content=\"10;url=\\$flowExecutionUrl&_eventId=proceed\">\n" + //
+                                "<!-- end added for OIDC RP-initiated logout -->\n\n";
+
+        replaceIdPHomeFile(pathToLogoutVm, oldText1, oldText1 + "\n" + newText1);
+
+        final String oldText2 = "<p><strong>#springMessageText\\(\"idp.logout.complete\", \"The logout operation is complete, and no other services appear to have been accessed during this session.\"\\)</strong></p>\n";
+
+        final String newText2 = "<!-- begin added for OIDC RP-initiated logout -->\n" + //
+                                "                #if (\\$postLogoutRedirectUri)\n" + //
+                                "                    <p>Text here to explain the link back to RP</p>\n" + //
+                                "                    <a href=\"\\$flowExecutionUrl&_eventId=proceed\">Link text</a>\n" + //
+                                "                #else\n" + //
+                                "<!-- end added for OIDC RP-initiated logout -->\n\n";
+
+        replaceIdPHomeFile(pathToLogoutVm, oldText2, oldText2 + "\n" + newText2);
+
+        final String oldText3 = "                <!-- Complete the flow by adding a hidden iframe. -->\n" + //
+                                "                <iframe style=\"display:none\" src=\"\\$flowExecutionUrl&_eventId=proceed\"></iframe>\n";
+
+        final String newText3 = "                #end\n";
+
+        replaceIdPHomeFile(pathToLogoutVm, oldText3, oldText3 + "\n" + newText3);
+    
+    }
+
+    /**
+     * Set up logout propagate view for conformance tests.
+     * 
+     * @throws IOException
+     *             if an error occurs
+     */
+    protected void setUpLogoutPropagateView() throws IOException {
+
+        final Path pathToLogoutPropagateVm = Paths.get("views", "logout-propagate.vm");
+
+        final String oldText1 ="<link rel=\"stylesheet\" type=\"text/css\" href=\"\\$request.getContextPath\\(\\)/css/logout.css\">";
+
+        final String newText1 = "<!-- begin added for OIDC RP-initiated logout -->\n" + //
+                                "        #if (\\$postLogoutRedirectUri)\n" + //
+                                "            <meta http-equiv=\"refresh\" content=\"1;url=\\$flowExecutionUrl&_eventId=proceed\">\n" + //
+                                "        #end\n" + //
+                                "<!-- end added for OIDC RP-initiated logout -->\n\n";
+
+       replaceIdPHomeFile(pathToLogoutPropagateVm, oldText1, oldText1 + "\n" + newText1);
+
+       final String oldText2 = "#parse\\(\"logout/propagate.vm\"\\)\n";
+
+       final String newText2 = "<!-- begin added for OIDC RP-initiated logout -->\n" + //
+                               "            #if (\\$postLogoutRedirectUri)\n" + //
+                               "                <p>Text here to explain the link back to RP</p>\n" + //
+                               "                <a href=\"\\$flowExecutionUrl&_eventId=proceed\">Link text</a>\n" + //
+                               "            #elseif (\\$oidcRpInitiatedLogoutContext)\n" + //
+                               "                <iframe style=\"display:none\" src=\"\\$flowExecutionUrl&_eventId=proceed\"></iframe>\n" + //
+                               "            #end\n" + //
+                               "<!-- end added for OIDC RP-initiated logout -->\n\n";
+
+       replaceIdPHomeFile(pathToLogoutPropagateVm, oldText2, oldText2 + "\n" + newText2);
+    }
+
     /**
      * Set up OP for conformance suite.
      * 
@@ -152,6 +225,10 @@ public class OPConformanceTest extends BaseOPTest {
         ignoreCertificateChecks();
 
         enableDynamicClientRegistration();
+
+        setUpLogoutView();
+
+        setUpLogoutPropagateView();
     }
 
     /**
@@ -238,6 +315,8 @@ public class OPConformanceTest extends BaseOPTest {
         setUpFirefoxDriver();
     }
 
+    // authorization tests
+
     @Test
     @IdPV5OrLater
     @LinuxOnly
@@ -455,6 +534,24 @@ public class OPConformanceTest extends BaseOPTest {
         conformanceSuite.runTest(description, testPlan);
     }
 
+    // logout tests
+
+    @Test(enabled = false)
+    @IdPV5OrLater
+    @LinuxOnly
+    @OPConformance
+    public void testBackchannelRpInitiatedLogoutCertificationProfileAuthorization() throws Exception {
+
+        final String description = "Backchannel RP initiated logout certification profile authorization test";
+
+        final String testPlan = //
+                "scripts/run-test-plan.py --verbose " + //
+                "'oidcc-backchannel-rp-initiated-logout-certification-test-plan[response_type=code][client_registration=dynamic_client]' " + //
+                "testop-config-logout.json";
+
+        conformanceSuite.runTest(description, testPlan);
+    }
+
     /**
      * Do not stop browser after each test.
      */

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


More information about the commits mailing list