From 8c2d4812b006803627c94003874de19d0386c910 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Wed, 29 Oct 2014 14:02:16 +0100 Subject: [PATCH 1/2] KEYCLOAK-763 Document reverse proxy setup on AS7/EAP --- .../en/en-US/modules/server-installation.xml | 67 ++++++++++++++++--- 1 file changed, 56 insertions(+), 11 deletions(-) diff --git a/docbook/reference/en/en-US/modules/server-installation.xml b/docbook/reference/en/en-US/modules/server-installation.xml index 9e595a194d..5ca0cd8f50 100755 --- a/docbook/reference/en/en-US/modules/server-installation.xml +++ b/docbook/reference/en/en-US/modules/server-installation.xml @@ -625,29 +625,74 @@ keycloak-war-dist-all-&project.version;/ X-Forwarded-Proto headers on the requests made to Keycloak. Next you need to enable proxy-address-forwarding on the Keycloak http connector. Assuming that your reverse proxy doesn't use port 8443 for SSL you also need to configure what port http traffic is redirected to. - This is done by editing standalone/configuration/standalone.xml. - First add proxy-address-forwarding and redirect-socket to the http-listener - element: - + +
+ WildFly + + + Open standalone/configuration/standalone.xml in your favorite editor. + + + + First add proxy-address-forwarding and redirect-socket to + the http-listener element: ... - + ... ]]> - Then add a new socket-binding element to the socket-binding-group element: + + + Then add a new socket-binding element to the socket-binding-group element: + ... ... ]]> - - - Check the WildFly documentation for more information. - + + + Check the WildFly documentation for more information. + +
+ +
+ AS7/EAP + + + Open standalone/configuration/standalone.xml in your favorite editor. + + + + You need to add redirect-port to http connector element and + add the RemoteIpValve valve: + + + + + + + + + + +]]> + + + + +
+
From 05b6dc7af4f7b1bd48bbb00444344981166b1842 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Wed, 29 Oct 2014 14:02:38 +0100 Subject: [PATCH 2/2] KEYCLOAK-797 login-status-iframe.html fails if domain contains hyphen --- core/src/main/java/org/keycloak/util/UriUtils.java | 2 +- core/src/test/java/org/keycloak/util/UriUtilsTest.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/keycloak/util/UriUtils.java b/core/src/main/java/org/keycloak/util/UriUtils.java index 8532c5b630..3f0f9afa62 100644 --- a/core/src/main/java/org/keycloak/util/UriUtils.java +++ b/core/src/main/java/org/keycloak/util/UriUtils.java @@ -8,7 +8,7 @@ import java.util.regex.Pattern; */ public class UriUtils { - private static final Pattern originPattern = Pattern.compile("(http://|https://)[\\w]+(\\.[\\w]+)*(:[\\d]{2,5})?"); + private static final Pattern originPattern = Pattern.compile("(http://|https://)[\\w-]+(\\.[\\w-]+)*(:[\\d]{2,5})?"); public static String getOrigin(URI uri) { return getOrigin(uri.toString()); diff --git a/core/src/test/java/org/keycloak/util/UriUtilsTest.java b/core/src/test/java/org/keycloak/util/UriUtilsTest.java index 52d484ded8..af89777dfb 100644 --- a/core/src/test/java/org/keycloak/util/UriUtilsTest.java +++ b/core/src/test/java/org/keycloak/util/UriUtilsTest.java @@ -24,6 +24,8 @@ public class UriUtilsTest { assertValid("http://192.168.123.123"); assertValid("https://192.168.123.123"); assertValid("https://192.168.123.123:8080"); + assertValid("https://sub-sub.test.com"); + assertValid("https://sub.test-test.com"); assertInvalid("https://test/"); assertInvalid("{");