From b6a4a6d847ba70e9f47b1990d30cc22f8884137e Mon Sep 17 00:00:00 2001 From: Stefan Guilhen Date: Wed, 18 Sep 2024 17:25:06 -0300 Subject: [PATCH 1/3] Action expired error occurs when accessing regular registration page with Organizations enabled Closes #33064 Signed-off-by: Stefan Guilhen --- js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts | 2 ++ .../keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts b/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts index bad706ac78dc..a39b351ba19b 100644 --- a/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts +++ b/js/apps/admin-ui/cypress/e2e/authentication_test.spec.ts @@ -211,6 +211,8 @@ describe("Authentication test", () => { }); it("Should display the default browser flow diagram", () => { + sidebarPage.goToRealm("master"); + sidebarPage.goToAuthentication(); listingPage.goToItemDetails("browser"); detailPage.goToDiagram(); diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java index ce92b9834835..34fa16c3f1c8 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java @@ -211,7 +211,7 @@ public AuthorizationEndpoint register(String tokenString) { event.event(EventType.REGISTER); action = Action.REGISTER; - if (Profile.isFeatureEnabled(Profile.Feature.ORGANIZATION)) { + if (Profile.isFeatureEnabled(Profile.Feature.ORGANIZATION) && tokenString != null) { //this call should extract orgId from token and set the organization to the session context Response errorResponse = new LoginActionsService(session, event).preHandleActionToken(tokenString); if (errorResponse != null) { From 7decc9d347f4c798849033d9300dc7b30ea18812 Mon Sep 17 00:00:00 2001 From: rmartinc Date: Thu, 19 Sep 2024 15:35:11 +0200 Subject: [PATCH 2/3] test Signed-off-by: Stefan Guilhen --- .../testsuite/util/ArtifactResolutionService.java | 2 +- .../ArtifactBindingWithResolutionServiceTest.java | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/ArtifactResolutionService.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/ArtifactResolutionService.java index 8b167533ba2d..408bfec50e7b 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/ArtifactResolutionService.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/ArtifactResolutionService.java @@ -43,7 +43,7 @@ public class ArtifactResolutionService implements Provider, Runnable { private ArtifactResponseType artifactResponseType; private final String endpointAddress; private ArtifactResolveType lastArtifactResolve; - private boolean running = true; + private volatile boolean running = true; /** * Standard constructor diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/ArtifactBindingWithResolutionServiceTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/ArtifactBindingWithResolutionServiceTest.java index 1ef887349f8e..59f0089c51f7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/ArtifactBindingWithResolutionServiceTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/saml/ArtifactBindingWithResolutionServiceTest.java @@ -55,8 +55,8 @@ public void testReceiveArtifactLoginFullWithPost() throws ParsingException, Conf ArtifactResolutionService ars = new ArtifactResolutionService("http://127.0.0.1:8082/").setResponseDocument(doc); Thread arsThread = new Thread(ars); try { - arsThread.start(); synchronized (ars) { + arsThread.start(); ars.wait(); SAMLDocumentHolder response = builder.artifactMessage(camb).build().login().user(bburkeUser).build().getSamlResponse(SamlClient.Binding.POST); assertThat(response.getSamlObject(), instanceOf(ResponseType.class)); @@ -90,8 +90,8 @@ public void testReceiveArtifactLoginFullWithRedirect() throws ParsingException, ArtifactResolutionService ars = new ArtifactResolutionService("http://127.0.0.1:8082/").setResponseDocument(doc); Thread arsThread = new Thread(ars); try { - arsThread.start(); synchronized (ars) { + arsThread.start(); ars.wait(); SAMLDocumentHolder response = builder.artifactMessage(camb).build().login().user(bburkeUser).build().getSamlResponse(REDIRECT); assertThat(response.getSamlObject(), instanceOf(ResponseType.class)); @@ -124,8 +124,8 @@ public void testReceiveArtifactNonExistingClient() throws ParsingException, Conf ArtifactResolutionService ars = new ArtifactResolutionService("http://127.0.0.1:8082/").setResponseDocument(doc); Thread arsThread = new Thread(ars); try { - arsThread.start(); synchronized (ars) { + arsThread.start(); ars.wait(); String response = builder.artifactMessage(camb).build().executeAndTransform(resp -> EntityUtils.toString(resp.getEntity())); assertThat(response, containsString("Invalid Request")); @@ -151,8 +151,8 @@ public void testReceiveEmptyArtifactResponse() throws InterruptedException { ArtifactResolutionService ars = new ArtifactResolutionService("http://127.0.0.1:8082/").setEmptyArtifactResponse(SAML_CLIENT_ID_SALES_POST); Thread arsThread = new Thread(ars); try { - arsThread.start(); synchronized (ars) { + arsThread.start(); ars.wait(); builder.artifactMessage(camb).build().execute(r -> { assertThat(r, statusCodeIsHC(400)); @@ -180,8 +180,8 @@ public void testReceiveArtifactLogoutFullWithPost() throws InterruptedException ArtifactResolutionService ars = new ArtifactResolutionService("http://127.0.0.1:8082/"); Thread arsThread = new Thread(ars); try { - arsThread.start(); synchronized (ars) { + arsThread.start(); ars.wait(); SAMLDocumentHolder samlResponse = builder.authnRequest(getAuthServerSamlEndpoint(REALM_NAME), SAML_CLIENT_ID_SALES_POST, SAML_ASSERTION_CONSUMER_URL_SALES_POST, POST).build() .login().user(bburkeUser).build() @@ -220,8 +220,8 @@ public void testReceiveArtifactLogoutFullWithRedirect() throws InterruptedExcept ArtifactResolutionService ars = new ArtifactResolutionService("http://127.0.0.1:8082/"); Thread arsThread = new Thread(ars); try { - arsThread.start(); synchronized (ars) { + arsThread.start(); ars.wait(); SAMLDocumentHolder samlResponse = builder .authnRequest(getAuthServerSamlEndpoint(REALM_NAME), SAML_CLIENT_ID_SALES_POST, From 8bebab6959f38b9394302499c5870fda7b766118 Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Thu, 19 Sep 2024 17:45:08 +0200 Subject: [PATCH 3/3] Disable remote operator tests Signed-off-by: Jon Koops --- .github/workflows/operator-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/operator-ci.yml b/.github/workflows/operator-ci.yml index 732b677d3b19..25db0b8113ad 100644 --- a/.github/workflows/operator-ci.yml +++ b/.github/workflows/operator-ci.yml @@ -99,6 +99,8 @@ jobs: test-remote: name: Test remote runs-on: ubuntu-latest + # The remote job is broken and holding up other PRs. + if: false needs: [build] steps: - uses: actions/checkout@v4