From f0bbcbf0fdc7271c6d804f3560a090863a71a417 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Tue, 24 Oct 2017 10:49:08 +0200 Subject: [PATCH] KEYCLOAK-5487 (#4603) --- .../services/resources/account/AccountConsole.java | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java b/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java index 20f3e79271..de29fd7245 100644 --- a/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java +++ b/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java @@ -85,13 +85,10 @@ public class AccountConsole { URI baseUri = uriInfo.getBaseUri(); - String authUrl = baseUri.toString(); - authUrl = authUrl.substring(0, authUrl.length() - 1); - - map.put("authUrl", authUrl); - map.put("baseUrl", authUrl + "/realms/" + realm.getName() + "/account"); + map.put("authUrl", session.getContext().getContextPath()); + map.put("baseUrl", session.getContext().getContextPath() + "/realms/" + realm.getName() + "/account"); map.put("realm", realm.getName()); - map.put("resourceUrl", Urls.themeRoot(baseUri) + "/account/" + theme.getName()); + map.put("resourceUrl", Urls.themeRoot(baseUri).getPath() + "/account/" + theme.getName()); map.put("resourceVersion", Version.RESOURCES_VERSION); String[] referrer = getReferrer();