Use the Keycloak server URL for common resources (#30823)
Closes #30541 Signed-off-by: Jon Koops <jonkoops@gmail.com>
This commit is contained in:
parent
261bc41af2
commit
cd0dbdf264
1 changed files with 2 additions and 8 deletions
|
@ -96,15 +96,9 @@ public class AccountConsole implements AccountResourceProvider {
|
||||||
@NoCache
|
@NoCache
|
||||||
@Path("{any:.*}")
|
@Path("{any:.*}")
|
||||||
public Response getMainPage() throws IOException, FreeMarkerException {
|
public Response getMainPage() throws IOException, FreeMarkerException {
|
||||||
// Get the URI info of the server and admin console.
|
|
||||||
final var serverUriInfo = session.getContext().getUri(UrlType.FRONTEND);
|
final var serverUriInfo = session.getContext().getUri(UrlType.FRONTEND);
|
||||||
final var adminUriInfo = session.getContext().getUri(UrlType.ADMIN);
|
|
||||||
|
|
||||||
// Get the base URLs of the server and admin console.
|
|
||||||
final var serverBaseUri = serverUriInfo.getBaseUri();
|
final var serverBaseUri = serverUriInfo.getBaseUri();
|
||||||
final var adminBaseUri = adminUriInfo.getBaseUri();
|
// Strip any trailing slashes from the URL.
|
||||||
|
|
||||||
// Strip any trailing slashes from the URLs.
|
|
||||||
final var serverBaseUrl = serverBaseUri.toString().replaceFirst("/+$", "");
|
final var serverBaseUrl = serverBaseUri.toString().replaceFirst("/+$", "");
|
||||||
|
|
||||||
final var map = new HashMap<String, Object>();
|
final var map = new HashMap<String, Object>();
|
||||||
|
@ -124,7 +118,7 @@ public class AccountConsole implements AccountResourceProvider {
|
||||||
map.put("realm", realm);
|
map.put("realm", realm);
|
||||||
map.put("clientId", Constants.ACCOUNT_CONSOLE_CLIENT_ID);
|
map.put("clientId", Constants.ACCOUNT_CONSOLE_CLIENT_ID);
|
||||||
map.put("resourceUrl", Urls.themeRoot(serverBaseUri).getPath() + "/" + Constants.ACCOUNT_MANAGEMENT_CLIENT_ID + "/" + theme.getName());
|
map.put("resourceUrl", Urls.themeRoot(serverBaseUri).getPath() + "/" + Constants.ACCOUNT_MANAGEMENT_CLIENT_ID + "/" + theme.getName());
|
||||||
map.put("resourceCommonUrl", Urls.themeRoot(adminBaseUri).getPath() + "/common/keycloak");
|
map.put("resourceCommonUrl", Urls.themeRoot(serverBaseUri).getPath() + "/common/keycloak");
|
||||||
map.put("resourceVersion", Version.RESOURCES_VERSION);
|
map.put("resourceVersion", Version.RESOURCES_VERSION);
|
||||||
|
|
||||||
String[] referrer = getReferrer();
|
String[] referrer = getReferrer();
|
||||||
|
|
Loading…
Reference in a new issue