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();