From cfee00d4c5e684611a38d7bef6c24bf48accc8ae Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Thu, 14 Aug 2014 11:01:04 -0400 Subject: [PATCH 1/2] fix relative uri problem --- .../en/en-US/modules/jboss-adapter.xml | 4 ++-- .../en/en-US/modules/server-installation.xml | 5 ++++ .../services/resources/TokenService.java | 23 +++++++++++++------ .../adapter/RelativeUriAdapterTest.java | 2 +- 4 files changed, 24 insertions(+), 10 deletions(-) diff --git a/docbook/reference/en/en-US/modules/jboss-adapter.xml b/docbook/reference/en/en-US/modules/jboss-adapter.xml index bd9d3a9ed0..c1413977c3 100755 --- a/docbook/reference/en/en-US/modules/jboss-adapter.xml +++ b/docbook/reference/en/en-US/modules/jboss-adapter.xml @@ -1,4 +1,4 @@ -
+
JBoss/Wildfly Adapter To be able to secure WAR apps deployed on JBoss AS 7.1.1, JBoss EAP 6.x, or Wildfly, you must install and @@ -7,7 +7,7 @@ to crack open your WARs at all and can apply Keycloak via the Keycloak Subsystem configuration in standalone.xml. Both methods are described in this section. -
+
Adapter Installation This is a adapter zip file for AS7, EAP, and Wildfly in the adapters/ directory in the Keycloak diff --git a/docbook/reference/en/en-US/modules/server-installation.xml b/docbook/reference/en/en-US/modules/server-installation.xml index 5904569ad2..32476ee420 100755 --- a/docbook/reference/en/en-US/modules/server-installation.xml +++ b/docbook/reference/en/en-US/modules/server-installation.xml @@ -106,6 +106,11 @@ keycloak-war-dist-all-1.0-rc-1-SNAPSHOT/ $ cp -r configuration $JBOSS_HOME/standalone + + After these steps you should also install the client adapter + as this may contain modules the server needs (like Bouncycastle). You will also need to install the adapter + to run the examples on the same server. + After booting up the JBoss or Wildfly distro, you can then make sure it is installed properly by logging into the admin console at resolveValidRedirects = new HashSet(); for (String validRedirect : validRedirects) { + resolveValidRedirects.add(validRedirect); // add even relative urls. if (validRedirect.startsWith("/")) { - URI baseUri = uriInfo.getBaseUri(); - String uri = baseUri.getScheme() + "://" + baseUri.getHost(); - if (baseUri.getPort() != -1) { - uri += ":" + baseUri.getPort(); - } - validRedirect = uri + validRedirect; + validRedirect = relativeToAbsoluteURI(uriInfo, validRedirect); logger.debugv("replacing relative valid redirect with: {0}", validRedirect); + resolveValidRedirects.add(validRedirect); } - resolveValidRedirects.add(validRedirect); } return resolveValidRedirects; } + public static String relativeToAbsoluteURI(UriInfo uriInfo, String relative) { + URI baseUri = uriInfo.getBaseUri(); + String uri = baseUri.getScheme() + "://" + baseUri.getHost(); + if (baseUri.getPort() != -1) { + uri += ":" + baseUri.getPort(); + } + relative = uri + relative; + return relative; + } + private boolean checkSsl() { if (uriInfo.getBaseUri().getScheme().equals("https")) { return true; diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/RelativeUriAdapterTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/RelativeUriAdapterTest.java index a9114ebf6d..b06d1b8a9a 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/RelativeUriAdapterTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/adapter/RelativeUriAdapterTest.java @@ -149,7 +149,7 @@ public class RelativeUriAdapterTest { // test logout String logoutUri = TokenService.logoutUrl(UriBuilder.fromUri("http://localhost:8081/auth")) - .queryParam(OAuth2Constants.REDIRECT_URI, "http://localhost:8081/customer-portal").build("demo").toString(); + .queryParam(OAuth2Constants.REDIRECT_URI, "/customer-portal").build("demo").toString(); driver.navigate().to(logoutUri); Assert.assertTrue(driver.getCurrentUrl().startsWith(LOGIN_URL)); driver.navigate().to("http://localhost:8081/product-portal"); From c38ec33881bd99a04199df8fd297f571592c1106 Mon Sep 17 00:00:00 2001 From: Bill Burke Date: Thu, 14 Aug 2014 11:59:03 -0400 Subject: [PATCH 2/2] tooltip fixes --- .../partials/application-claims.html | 2 +- .../partials/application-detail.html | 12 +- .../partials/application-installation.html | 2 +- .../resources/partials/application-list.html | 2 +- .../partials/application-revocation.html | 2 +- .../partials/application-role-detail.html | 12 +- .../partials/application-scope-mappings.html | 22 +- .../partials/application-sessions.html | 4 +- .../base/resources/partials/brute-force.html | 14 +- .../resources/partials/defense-headers.html | 6 +- .../resources/partials/federated-ldap.html | 376 +++++++++--------- .../partials/oauth-client-claims.html | 2 +- .../partials/oauth-client-detail.html | 10 +- .../partials/oauth-client-installation.html | 2 +- .../resources/partials/oauth-client-list.html | 2 +- .../partials/oauth-client-revocation.html | 2 +- .../partials/oauth-client-scope-mappings.html | 22 +- .../partials/realm-cache-settings.html | 4 +- .../resources/partials/realm-credentials.html | 4 +- .../partials/realm-default-roles.html | 14 +- .../base/resources/partials/realm-detail.html | 2 +- .../base/resources/partials/realm-keys.html | 2 +- .../partials/realm-login-settings.html | 166 ++++---- .../base/resources/partials/realm-smtp.html | 2 +- .../partials/realm-theme-settings.html | 10 +- .../base/resources/partials/realm-tokens.html | 10 +- .../base/resources/partials/role-detail.html | 12 +- .../resources/partials/role-mappings.html | 18 +- .../partials/session-revocation.html | 2 +- .../base/resources/partials/user-detail.html | 6 +- 30 files changed, 373 insertions(+), 373 deletions(-) diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-claims.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-claims.html index a29215ac58..ad47e2d732 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-claims.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-claims.html @@ -12,7 +12,7 @@

-

{{application.name}} Allowed Claims

+

{{application.name}} Allowed Claims

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-detail.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-detail.html index 741f53f733..5eb4cabc64 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-detail.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-detail.html @@ -35,7 +35,7 @@
- +
@@ -48,7 +48,7 @@
- +
@@ -72,7 +72,7 @@
- +
@@ -80,7 +80,7 @@
- +
@@ -88,7 +88,7 @@
- +
@@ -112,7 +112,7 @@
- + diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-installation.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-installation.html index 4187bf963d..8fa23df4fb 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-installation.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-installation.html @@ -14,7 +14,7 @@

-

{{application.name}} Installation

+

{{application.name}} Installation

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-list.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-list.html index 37cb2ab557..0e8fa566b9 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-list.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-list.html @@ -5,7 +5,7 @@

-

{{realm.realm}} Applications

+

{{realm.realm}} Applications

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-revocation.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-revocation.html index 9670154138..a2907c5cde 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-revocation.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-revocation.html @@ -20,7 +20,7 @@
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html index ebb96c5c9c..1291a29039 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/application-role-detail.html @@ -49,7 +49,7 @@
-
+ @@ -58,7 +58,7 @@
- + Select an Application...
-
+
- +

-

{{application.name}} Scope Mappings

+

{{application.name}} Scope Mappings

@@ -22,18 +22,18 @@
- +
- Realm Roles + Realm Roles
- +
- +
- +

-

{{application.name}} Sessions

+

{{application.name}} Sessions

@@ -20,7 +20,7 @@
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/brute-force.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/brute-force.html index 6567e5992e..46ad5b57e3 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/brute-force.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/brute-force.html @@ -6,7 +6,7 @@

-

{{realm.realm}} Brute Force Protection

+

{{realm.realm}} Brute Force Protection

@@ -22,7 +22,7 @@
- +
@@ -43,7 +43,7 @@
- +
@@ -52,7 +52,7 @@
- +
@@ -73,7 +73,7 @@
- +
@@ -94,7 +94,7 @@
- +
@@ -115,7 +115,7 @@
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/defense-headers.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/defense-headers.html index 3f334d184b..b5aec466c0 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/defense-headers.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/defense-headers.html @@ -7,7 +7,7 @@

-

{{realm.realm}} Browser Security Headers

+

{{realm.realm}} Browser Security Headers

@@ -15,14 +15,14 @@
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-ldap.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-ldap.html index 26c971a990..feb53e4e11 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-ldap.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-ldap.html @@ -1,189 +1,189 @@ -
-
- -

-
-

{{realm.realm}} Ldap Server Settings

-

* Required fields

- - -
- Required Settings -
- -
- -
-
-
- -
- -
- -
-
- -
- -
- -
-
- -
-
- -
-
- -
-
- -
- -
- -
-
- -
-
- -
-
-
-
- -
-
- -
-
-
-
- -
- -
-
-
- -
- -
- -
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
- -
-
- -
- -
-
-
- -
- -
- -
-
- -
- -
-
-
- -
- Sync settings -
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- -
-
-
- -
- - -
- -
- - - - - -
- -
+
+
+ +

+
+

{{realm.realm}} Ldap Server Settings

+

* Required fields

+
+ +
+ Required Settings +
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+
+
+ +
+
+ +
+
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+ +
+ +
+ +
+
+ +
+ +
+
+
+ +
+ Sync settings +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ + +
+ +
+ + + + + +
+ +
\ No newline at end of file diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-claims.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-claims.html index 756a45159a..678f798bd9 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-claims.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-claims.html @@ -10,7 +10,7 @@

-

{{oauth.name}} Allowed Claims

+

{{oauth.name}} Allowed Claims

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-detail.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-detail.html index 76167450eb..037adeba1e 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-detail.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-detail.html @@ -35,7 +35,7 @@
- +
@@ -48,14 +48,14 @@
- +
- +
@@ -79,7 +79,7 @@
- +
@@ -103,7 +103,7 @@
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-installation.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-installation.html index f20e8ba2e4..6c98d062ef 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-installation.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-installation.html @@ -10,7 +10,7 @@

-

OAuth Client Installation

+

OAuth Client Installation

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-list.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-list.html index a19323f4cf..316490e7a7 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-list.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-list.html @@ -5,7 +5,7 @@

-

{{realm.realm}} OAuth Clients

+

{{realm.realm}} OAuth Clients

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-revocation.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-revocation.html index 16941d66b9..12ce31755f 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-revocation.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-revocation.html @@ -18,7 +18,7 @@
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-scope-mappings.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-scope-mappings.html index 707cc3d2f6..13b61f4e4b 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-scope-mappings.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/oauth-client-scope-mappings.html @@ -11,7 +11,7 @@

-

{{oauth.name}} Scope Mappings

+

{{oauth.name}} Scope Mappings

@@ -20,17 +20,17 @@
- +
- Realm Roles + Realm Roles
- +
- +
- +
- +
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-credentials.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-credentials.html index a5042406b2..1f0e9f5f32 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-credentials.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-credentials.html @@ -7,7 +7,7 @@

{{realm.realm}} Credentials

- Realm Credentials Settings + Realm Credentials Settings
@@ -17,7 +17,7 @@
- Realm Password Policy + Realm Password Policy
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-default-roles.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-default-roles.html index a8af7dd7e1..2bd412c21b 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-default-roles.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-default-roles.html @@ -6,14 +6,14 @@

-

{{realm.realm}} Default Roles

+

{{realm.realm}} Default Roles

Realm Default Roles
- + Application Default Roles
- +
@@ -53,12 +53,12 @@
- +
- +
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-keys.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-keys.html index b56dcc4c7f..f5f300ddc4 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-keys.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-keys.html @@ -3,7 +3,7 @@

-

{{realm.realm}} Realm Public Key

+

{{realm.realm}} Realm Public Key

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-login-settings.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-login-settings.html index b348a9a42c..27696ef963 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-login-settings.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-login-settings.html @@ -1,84 +1,84 @@ -
-
- -

-
-
-

{{realm.realm}} Login Settings

- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
- -
- -
-
- -
-
- -
-
- -
-
-
- - -
- -
-
-

{{realm.realm}}

-
- -
+
+
+ +

+
+
+

{{realm.realm}} Login Settings

+
+
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+
+ + +
+ +
+
+

{{realm.realm}}

+
+ +
\ No newline at end of file diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-smtp.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-smtp.html index 30cd1d058b..bcc51d0466 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-smtp.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-smtp.html @@ -3,7 +3,7 @@

-

{{realm.realm}} Email Settings

+

{{realm.realm}} Email Settings

* Required fields

diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-theme-settings.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-theme-settings.html index 3f37c09a8c..81294694c9 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-theme-settings.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-theme-settings.html @@ -4,7 +4,7 @@

-

{{realm.realm}} Theme Settings

+

{{realm.realm}} Theme Settings

@@ -18,7 +18,7 @@
- +
@@ -31,7 +31,7 @@
- +
@@ -44,7 +44,7 @@
- +
@@ -57,7 +57,7 @@
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-tokens.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-tokens.html index 39768aac6c..b2833c9466 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-tokens.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/realm-tokens.html @@ -29,7 +29,7 @@
- +
@@ -50,7 +50,7 @@
- +
@@ -71,7 +71,7 @@
- +
@@ -90,7 +90,7 @@
- +
@@ -109,7 +109,7 @@
- +
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-detail.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-detail.html index 72ac2d28e4..cb590c9afa 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-detail.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/role-detail.html @@ -34,7 +34,7 @@
-
+
@@ -46,7 +46,7 @@
- + Select an Application...
-
+
- +
- Realm Roles + Realm Roles
-
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/user-detail.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/user-detail.html index 7b1e10c5ce..cbef2a58de 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/user-detail.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/user-detail.html @@ -67,7 +67,7 @@
- +
@@ -80,7 +80,7 @@
- +
@@ -90,7 +90,7 @@
- +