From 98e5e9799ba47d218690289ffb631dfee6ddb3c3 Mon Sep 17 00:00:00 2001 From: Jon Koops Date: Tue, 23 May 2023 11:42:34 +0200 Subject: [PATCH] Improve third-party storage access detection and cookie fallback --- .../oidc/endpoints/3p-cookies-step1.html | 57 ++++-- .../oidc/endpoints/3p-cookies-step2.html | 9 +- .../oidc/endpoints/login-status-iframe.html | 175 +++++++----------- .../oauth/LoginStatusIframeEndpointTest.java | 3 - 4 files changed, 118 insertions(+), 126 deletions(-) diff --git a/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step1.html b/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step1.html index 7a66f3ab78..ecd6e26eca 100644 --- a/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step1.html +++ b/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step1.html @@ -1,29 +1,58 @@ - + - diff --git a/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step2.html b/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step2.html index 36591b59b6..06a7f02335 100644 --- a/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step2.html +++ b/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/3p-cookies-step2.html @@ -1,17 +1,20 @@ - + - diff --git a/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/login-status-iframe.html b/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/login-status-iframe.html index f1abfc2e41..01b31c1713 100755 --- a/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/login-status-iframe.html +++ b/services/src/main/resources/org/keycloak/protocol/oidc/endpoints/login-status-iframe.html @@ -1,125 +1,88 @@ - + - diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LoginStatusIframeEndpointTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LoginStatusIframeEndpointTest.java index 0250c610a9..82cb2942b8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LoginStatusIframeEndpointTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/LoginStatusIframeEndpointTest.java @@ -123,9 +123,6 @@ public class LoginStatusIframeEndpointTest extends AbstractKeycloakTest { response = client.execute(get); assertEquals(200, response.getStatusLine().getStatusCode()); - s = IOUtils.toString(response.getEntity().getContent(), "UTF-8"); - assertTrue(s.contains("function getCookie()")); - assertEquals("CP=\"This is not a P3P policy!\"", response.getFirstHeader("P3P").getValue()); assertNull(response.getFirstHeader(BrowserSecurityHeaders.X_FRAME_OPTIONS.getHeaderName())); assertEquals("frame-src 'self'; object-src 'none';", response.getFirstHeader(BrowserSecurityHeaders.CONTENT_SECURITY_POLICY.getHeaderName()).getValue());