Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Keycloak cleanup and added account page to UI (implements #179)

Rich Turneredcdc83a317f
diff --git a/deployment/manager/shared/locales/en/or.json b/deployment/manager/shared/locales/en/or.json
index e9fd23a96..a30170e39 100644
--- a/deployment/manager/shared/locales/en/or.json
+++ b/deployment/manager/shared/locales/en/or.json
@@ -250,5 +250,6 @@
"GBP_PER_KILOWATT_HOUR": "£/kWh",
"GBP_PER_MONTH": "£/month"
},
- "noChildAssets": "No child assets"
+ "noChildAssets": "No child assets",
+ "account": "Account"
}
diff --git a/manager/src/main/java/org/openremote/manager/security/ManagerBasicIdentityProvider.java b/manager/src/main/java/org/openremote/manager/security/ManagerBasicIdentityProvider.java
index 227a3f7bd..2c8d94cae 100644
--- a/manager/src/main/java/org/openremote/manager/security/ManagerBasicIdentityProvider.java
+++ b/manager/src/main/java/org/openremote/manager/security/ManagerBasicIdentityProvider.java
@@ -205,12 +205,7 @@ public class ManagerBasicIdentityProvider extends BasicIdentityProvider implemen
}
@Override
- public void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant) {
- throw new UnsupportedOperationException("This provider does not support multiple tenants");
- }
-
- @Override
- public void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant, TenantEmailConfig emailConfig) {
+ public void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant, Container container) {
throw new UnsupportedOperationException("This provider does not support multiple tenants");
}
diff --git a/manager/src/main/java/org/openremote/manager/security/ManagerIdentityProvider.java b/manager/src/main/java/org/openremote/manager/security/ManagerIdentityProvider.java
index 05f05aa6e..c11b391bb 100644
--- a/manager/src/main/java/org/openremote/manager/security/ManagerIdentityProvider.java
+++ b/manager/src/main/java/org/openremote/manager/security/ManagerIdentityProvider.java
@@ -19,6 +19,7 @@
*/
package org.openremote.manager.security;
+import org.openremote.container.Container;
import org.openremote.container.persistence.PersistenceService;
import org.openremote.container.security.AuthContext;
import org.openremote.container.security.IdentityProvider;
@@ -79,9 +80,7 @@ public interface ManagerIdentityProvider extends IdentityProvider {
void updateTenant(ClientRequestInfo clientRequestInfo, String realm, Tenant tenant);
- void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant);
-
- void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant, TenantEmailConfig emailConfig);
+ void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant, Container container);
void deleteTenant(ClientRequestInfo clientRequestInfo, String realm);
diff --git a/manager/src/main/java/org/openremote/manager/security/ManagerIdentityService.java b/manager/src/main/java/org/openremote/manager/security/ManagerIdentityService.java
index a53fd9b6b..2e0a8c916 100644
--- a/manager/src/main/java/org/openremote/manager/security/ManagerIdentityService.java
+++ b/manager/src/main/java/org/openremote/manager/security/ManagerIdentityService.java
@@ -23,7 +23,6 @@ import org.openremote.container.Container;
import org.openremote.container.persistence.PersistenceService;
import org.openremote.container.security.IdentityService;
import org.openremote.container.timer.TimerService;
-import org.openremote.container.web.WebService;
import org.openremote.manager.web.ManagerWebService;
import javax.persistence.EntityManager;
@@ -43,7 +42,7 @@ public class ManagerIdentityService extends IdentityService {
persistenceService = container.getService(PersistenceService.class);
container.getService(ManagerWebService.class).getApiSingletons().add(
- new TenantResourceImpl(container.getService(TimerService.class), this)
+ new TenantResourceImpl(container.getService(TimerService.class), this, container)
);
container.getService(ManagerWebService.class).getApiSingletons().add(
new UserResourceImpl(container.getService(TimerService.class), this)
diff --git a/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java b/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java
index 749f25ceb..b96844875 100644
--- a/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java
+++ b/manager/src/main/java/org/openremote/manager/security/ManagerKeycloakIdentityProvider.java
@@ -19,6 +19,7 @@
*/
package org.openremote.manager.security;
+import io.undertow.util.Headers;
import org.apache.camel.ExchangePattern;
import org.keycloak.TokenVerifier;
import org.keycloak.admin.client.resource.*;
@@ -48,15 +49,19 @@ import org.openremote.model.util.TextUtil;
import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilder;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
+import java.util.*;
import java.util.logging.Level;
import java.util.logging.Logger;
+import static org.openremote.container.security.IdentityService.IDENTITY_NETWORK_HOST;
+import static org.openremote.container.security.IdentityService.IDENTITY_NETWORK_HOST_DEFAULT;
import static org.openremote.container.util.JsonUtil.convert;
-import static org.openremote.container.web.WebClient.getTarget;
-import static org.openremote.manager.setup.AbstractKeycloakSetup.*;
+import static org.openremote.container.util.MapAccess.getBoolean;
+import static org.openremote.container.util.MapAccess.getString;
+import static org.openremote.container.web.WebService.WEBSERVER_ALLOWED_ORIGINS;
+import static org.openremote.container.web.WebService.WEBSERVER_ALLOWED_ORIGINS_DEFAULT;
+import static org.openremote.manager.setup.AbstractKeycloakSetup.SETUP_EMAIL_FROM_KEYCLOAK;
+import static org.openremote.manager.setup.AbstractKeycloakSetup.SETUP_EMAIL_FROM_KEYCLOAK_DEFAULT;
import static org.openremote.model.Constants.*;
public class ManagerKeycloakIdentityProvider extends KeycloakIdentityProvider implements ManagerIdentityProvider {
@@ -265,20 +270,15 @@ public class ManagerKeycloakIdentityProvider extends KeycloakIdentityProvider im
}
@Override
- public void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant) {
- createTenant(clientRequestInfo, tenant, null);
- }
-
- @Override
- public void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant, TenantEmailConfig emailConfig) {
+ public void createTenant(ClientRequestInfo clientRequestInfo, Tenant tenant, Container container) {
LOG.fine("Create tenant: " + tenant);
RealmRepresentation realmRepresentation = convert(Container.JSON, RealmRepresentation.class, tenant);
- configureRealm(realmRepresentation, emailConfig);
- clientRequestInfo = new ClientRequestInfo(clientRequestInfo.getRemoteAddress(), getAdminAccessToken(clientRequestInfo));
// TODO This is not atomic, write compensation actions
getRealms(clientRequestInfo).create(realmRepresentation);
+ realmRepresentation = getRealms(clientRequestInfo).realm(tenant.getRealm()).toRepresentation();
+ configureRealm(realmRepresentation, container);
+ clientRequestInfo = new ClientRequestInfo(clientRequestInfo.getRemoteAddress(), getAdminAccessToken(clientRequestInfo));
createClientApplication(clientRequestInfo, realmRepresentation.getRealm());
-
publishModification(PersistenceEvent.Cause.CREATE, tenant);
}
@@ -360,10 +360,44 @@ public class ManagerKeycloakIdentityProvider extends KeycloakIdentityProvider im
}
- public void configureRealm(RealmRepresentation realmRepresentation, TenantEmailConfig emailConfig) {
+ public void configureRealm(RealmRepresentation realmRepresentation, Container container) {
configureRealm(realmRepresentation, Constants.ACCESS_TOKEN_LIFESPAN_SECONDS);
- if (emailConfig != null)
- realmRepresentation.setSmtpServer(emailConfig.asMap());
+
+ // Configure SMTP
+ String host = container.getConfig().getOrDefault(SETUP_EMAIL_HOST, null);
+ if (!TextUtil.isNullOrEmpty(host) && (realmRepresentation.getSmtpServer() == null || realmRepresentation.getSmtpServer().isEmpty())) {
+ LOG.info("Configuring Keycloak SMTP settings for realm: " + realmRepresentation.getRealm());
+ Map<String, String> emailConfig = new HashMap<>();
+ emailConfig.put("host", host);
+ emailConfig.put("port", container.getConfig().getOrDefault(SETUP_EMAIL_PORT, Integer.toString(SETUP_EMAIL_PORT_DEFAULT)));
+ emailConfig.put("user", container.getConfig().getOrDefault(SETUP_EMAIL_USER, null));
+ emailConfig.put("password", container.getConfig().getOrDefault(SETUP_EMAIL_PASSWORD, null));
+ emailConfig.put("auth", container.getConfig().containsKey(SETUP_EMAIL_USER) ? "true" : "false");
+ emailConfig.put("tls", Boolean.toString(getBoolean(container.getConfig(), SETUP_EMAIL_TLS, SETUP_EMAIL_TLS_DEFAULT)));
+ emailConfig.put("from", getString(container.getConfig(), SETUP_EMAIL_FROM_KEYCLOAK, SETUP_EMAIL_FROM_KEYCLOAK_DEFAULT + getString(container.getConfig(), IDENTITY_NETWORK_HOST, IDENTITY_NETWORK_HOST_DEFAULT)));
+ realmRepresentation.setSmtpServer(emailConfig);
+ }
+
+ // Configure CSP header
+ Map<String, String> headers = realmRepresentation.getBrowserSecurityHeaders();
+ if (headers == null) {
+ headers = new HashMap<>();
+ realmRepresentation.setBrowserSecurityHeaders(headers);
+ }
+
+ if (container.isDevMode()) {
+ headers.computeIfPresent("contentSecurityPolicy", (hdrName, hdrValue) -> "frame-src *; frame-ancestors *; object-src 'none'");
+ } else {
+ String allowedOriginsStr = getString(container.getConfig(), WEBSERVER_ALLOWED_ORIGINS, WEBSERVER_ALLOWED_ORIGINS_DEFAULT);
+ if (!TextUtil.isNullOrEmpty(allowedOriginsStr)) {
+ headers.compute("contentSecurityPolicy", (hdrName, hdrValue) ->
+ "frame-src 'self' " +
+ allowedOriginsStr.replace(';', ' ') +
+ "; frame-ancestors 'self' " +
+ allowedOriginsStr.replace(';', ' ') +
+ "; object-src 'none'");
+ }
+ }
}
public void createClientApplication(ClientRequestInfo clientRequestInfo, String realm) {
diff --git a/manager/src/main/java/org/openremote/manager/security/TenantResourceImpl.java b/manager/src/main/java/org/openremote/manager/security/TenantResourceImpl.java
index 626d7828c..6aced13de 100644
--- a/manager/src/main/java/org/openremote/manager/security/TenantResourceImpl.java
+++ b/manager/src/main/java/org/openremote/manager/security/TenantResourceImpl.java
@@ -19,6 +19,7 @@
*/
package org.openremote.manager.security;
+import org.openremote.container.Container;
import org.openremote.container.timer.TimerService;
import org.openremote.container.web.ClientRequestInfo;
import org.openremote.manager.i18n.I18NService;
@@ -45,9 +46,11 @@ import static org.openremote.model.http.BadRequestError.VIOLATION_EXCEPTION_HEAD
public class TenantResourceImpl extends ManagerWebResource implements TenantResource {
private static final Logger LOG = Logger.getLogger(TenantResourceImpl.class.getName());
+ protected Container container;
- public TenantResourceImpl(TimerService timerService, ManagerIdentityService identityService) {
+ public TenantResourceImpl(TimerService timerService, ManagerIdentityService identityService, Container container) {
super(timerService, identityService);
+ this.container = container;
}
@Override
@@ -108,7 +111,7 @@ public class TenantResourceImpl extends ManagerWebResource implements TenantReso
}
try {
identityService.getIdentityProvider().createTenant(
- new ClientRequestInfo(getClientRemoteAddress(), requestParams.getBearerAuth()), tenant
+ new ClientRequestInfo(getClientRemoteAddress(), requestParams.getBearerAuth()), tenant, container
);
} catch (ClientErrorException ex) {
throw new WebApplicationException(ex.getCause(), ex.getResponse().getStatus());
diff --git a/manager/src/main/java/org/openremote/manager/setup/AbstractKeycloakSetup.java b/manager/src/main/java/org/openremote/manager/setup/AbstractKeycloakSetup.java
index b8db33e9e..1f3107f15 100644
--- a/manager/src/main/java/org/openremote/manager/setup/AbstractKeycloakSetup.java
+++ b/manager/src/main/java/org/openremote/manager/setup/AbstractKeycloakSetup.java
@@ -28,16 +28,11 @@ import org.openremote.container.security.PasswordAuthForm;
import org.openremote.container.security.keycloak.KeycloakIdentityProvider;
import org.openremote.manager.security.ManagerIdentityService;
import org.openremote.manager.security.ManagerKeycloakIdentityProvider;
-import org.openremote.model.security.TenantEmailConfig;
-import org.openremote.model.util.TextUtil;
-import static org.openremote.container.security.IdentityService.IDENTITY_NETWORK_HOST;
-import static org.openremote.container.security.IdentityService.IDENTITY_NETWORK_HOST_DEFAULT;
-import static org.openremote.container.util.MapAccess.getBoolean;
-import static org.openremote.container.util.MapAccess.getInteger;
import static org.openremote.manager.security.ManagerIdentityProvider.SETUP_ADMIN_PASSWORD;
import static org.openremote.manager.security.ManagerIdentityProvider.SETUP_ADMIN_PASSWORD_DEFAULT;
-import static org.openremote.model.Constants.*;
+import static org.openremote.model.Constants.MASTER_REALM;
+import static org.openremote.model.Constants.MASTER_REALM_ADMIN_USER;
public abstract class AbstractKeycloakSetup implements Setup {
@@ -48,7 +43,6 @@ public abstract class AbstractKeycloakSetup implements Setup {
final protected ManagerIdentityService identityService;
final protected ManagerKeycloakIdentityProvider keycloakProvider;
final protected SetupService setupService;
- final protected TenantEmailConfig emailConfig;
protected String accessToken;
protected RealmResource masterRealmResource;
protected ClientsResource masterClientsResource;
@@ -59,25 +53,6 @@ public abstract class AbstractKeycloakSetup implements Setup {
this.identityService = container.getService(ManagerIdentityService.class);
this.keycloakProvider = ((ManagerKeycloakIdentityProvider)identityService.getIdentityProvider());
this.setupService = container.getService(SetupService.class);
-
- // Configure SMTP
- String host = container.getConfig().getOrDefault(SETUP_EMAIL_HOST, null);
-
- if (!TextUtil.isNullOrEmpty(host)) {
- String user = container.getConfig().getOrDefault(SETUP_EMAIL_USER, null);
- String password = container.getConfig().getOrDefault(SETUP_EMAIL_PASSWORD, null);
-
- emailConfig = new TenantEmailConfig();
- emailConfig.setHost(host);
- emailConfig.setStarttls(getBoolean(container.getConfig(), SETUP_EMAIL_TLS, SETUP_EMAIL_TLS_DEFAULT));
- emailConfig.setPort(getInteger(container.getConfig(), SETUP_EMAIL_PORT, SETUP_EMAIL_PORT_DEFAULT));
- emailConfig.setAuth(!TextUtil.isNullOrEmpty(user));
- emailConfig.setUser(user);
- emailConfig.setPassword(password);
- emailConfig.setFrom(container.getConfig().getOrDefault(SETUP_EMAIL_FROM_KEYCLOAK, SETUP_EMAIL_FROM_KEYCLOAK_DEFAULT + container.getConfig().getOrDefault(IDENTITY_NETWORK_HOST, IDENTITY_NETWORK_HOST_DEFAULT)));
- } else {
- emailConfig = null;
- }
}
public ManagerKeycloakIdentityProvider getKeycloakProvider() {
diff --git a/manager/src/main/java/org/openremote/manager/setup/builtin/KeycloakDemoSetup.java b/manager/src/main/java/org/openremote/manager/setup/builtin/KeycloakDemoSetup.java
index fdb0c53c6..d6b664a53 100644
--- a/manager/src/main/java/org/openremote/manager/setup/builtin/KeycloakDemoSetup.java
+++ b/manager/src/main/java/org/openremote/manager/setup/builtin/KeycloakDemoSetup.java
@@ -80,14 +80,14 @@ public class KeycloakDemoSetup extends AbstractKeycloakSetup {
tenantBuilding.setRealm("building");
tenantBuilding.setDisplayName("Building");
tenantBuilding.setEnabled(true);
- keycloakProvider.createTenant(new ClientRequestInfo(null, accessToken), tenantBuilding, emailConfig);
+ keycloakProvider.createTenant(new ClientRequestInfo(null, accessToken), tenantBuilding, container);
tenantBuilding = keycloakProvider.getTenant(tenantBuilding.getRealm());
tenantCity = new Tenant();
tenantCity.setRealm("smartcity");
tenantCity.setDisplayName("Smart City");
tenantCity.setEnabled(true);
- keycloakProvider.createTenant(new ClientRequestInfo(null, accessToken), tenantCity, emailConfig);
+ keycloakProvider.createTenant(new ClientRequestInfo(null, accessToken), tenantCity, container);
tenantCity = keycloakProvider.getTenant(tenantCity.getRealm());
// Users
diff --git a/manager/src/main/java/org/openremote/manager/setup/builtin/KeycloakInitSetup.java b/manager/src/main/java/org/openremote/manager/setup/builtin/KeycloakInitSetup.java
index f68263d56..86e4fbf7e 100644
--- a/manager/src/main/java/org/openremote/manager/setup/builtin/KeycloakInitSetup.java
+++ b/manager/src/main/java/org/openremote/manager/setup/builtin/KeycloakInitSetup.java
@@ -63,7 +63,7 @@ public class KeycloakInitSetup extends AbstractKeycloakSetup {
masterRealm.setLoginTheme(masterRealmKeycloakTheme);
// Set SMTP server, theme, timeouts, etc.
- keycloakProvider.configureRealm(masterRealm, emailConfig);
+ keycloakProvider.configureRealm(masterRealm, container);
masterRealmResource.update(masterRealm);
diff --git a/model/src/main/java/org/openremote/model/security/TenantEmailConfig.java b/model/src/main/java/org/openremote/model/security/TenantEmailConfig.java
deleted file mode 100644
index 7f7b30072..000000000
--- a/model/src/main/java/org/openremote/model/security/TenantEmailConfig.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2017, OpenRemote Inc.
- *
- * See the CONTRIBUTORS.txt file in the distribution for a
- * full listing of individual contributors.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-package org.openremote.model.security;
-
-import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
-import com.fasterxml.jackson.annotation.JsonProperty;
-
-import java.util.HashMap;
-import java.util.Map;
-
-@JsonIgnoreProperties({"password", "auth", "port", "host", "from", "user", "ssl", "starttls"})
-public class TenantEmailConfig {
- @JsonProperty
- protected Map<String,String> settings = new HashMap<>();
-
- public Map<String,String> asMap() {
- return settings;
- }
-
- public void setPassword(String password) {
- settings.put("password", password);
- }
-
- public String getPassword() {
- return settings.get("password");
- }
-
- public Boolean isAuth() {
- return settings.containsKey("auth") ? Boolean.parseBoolean(settings.get("auth")) : null;
- }
-
- public void setAuth(boolean auth) {
- settings.put("auth", Boolean.toString(auth));
- }
-
- public Integer getPort() {
- return settings.containsKey("port") ? Integer.parseInt(settings.get("port")) : null;
- }
-
- public void setPort(int port) {
- settings.put("port", Integer.toString(port));
- }
-
- public String getHost() {
- return settings.get("host");
- }
-
- public void setHost(String host) {
- settings.put("host", host);
- }
-
- public String getFrom() {
- return settings.get("from");
- }
-
- public void setFrom(String from) {
- settings.put("from", from);
- }
-
- public String getUser() {
- return settings.get("user");
- }
-
- public void setUser(String user) {
- settings.put("user", user);
- }
-
- public Boolean isSsl() {
- return settings.containsKey("ssl") ? Boolean.parseBoolean(settings.get("ssl")) : null;
- }
-
- public void setSsl(boolean ssl) {
- settings.put("ssl", Boolean.toString(ssl));
- }
-
- public Boolean isStarttls() {
- return settings.containsKey("starttls") ? Boolean.parseBoolean(settings.get("starttls")) : null;
- }
-
- public void setStarttls(boolean starttls) {
- settings.put("starttls", Boolean.toString(starttls));
- }
-}
diff --git a/ui/app/or-app/src/index.ts b/ui/app/or-app/src/index.ts
index 5aedaf6d2..ae0c728bf 100644
--- a/ui/app/or-app/src/index.ts
+++ b/ui/app/or-app/src/index.ts
@@ -176,7 +176,16 @@ export function headerItemLogs<S extends AppStateKeyed, A extends AnyAction>(orA
};
}
-function getRealm(): string {
+export function headerItemAccount<S extends AppStateKeyed, A extends AnyAction>(orApp: OrApp<S>): HeaderItem {
+ return {
+ icon: "account",
+ value: "account",
+ href: "#!account",
+ text: "account"
+ };
+}
+
+function getRealmQueryParameter(): string {
return Util.getQueryParameter(location.search, "realm");
}
@@ -184,7 +193,7 @@ const DEFAULT_MANAGER_CONFIG: ManagerConfig = {
managerUrl: MANAGER_URL,
auth: Auth.KEYCLOAK,
autoLogin: true,
- realm: getRealm(),
+ realm: getRealmQueryParameter(),
consoleAutoEnable: true,
loadTranslations: ["app", "or"]
};
@@ -317,7 +326,7 @@ export class OrApp<S extends AppStateKeyed> extends LitElement {
})
}
- const realm = getRealm();
+ const realm = getRealmQueryParameter();
const config = this._getConfig(realm);
if (!config) {
diff --git a/ui/app/or-app/src/pages/page-account.ts b/ui/app/or-app/src/pages/page-account.ts
new file mode 100644
index 000000000..083259035
--- /dev/null
+++ b/ui/app/or-app/src/pages/page-account.ts
@@ -0,0 +1,56 @@
+import {css, customElement, html, property, PropertyValues, TemplateResult, unsafeCSS} from "lit-element";
+import manager from "@openremote/core";
+import "@openremote/or-panel";
+import "@openremote/or-translate";
+import {AppStateKeyed, Page} from "../index";
+import {EnhancedStore} from "@reduxjs/toolkit";
+
+export function pageAccountProvider<S extends AppStateKeyed>(store: EnhancedStore<S>) {
+ return {
+ routes: [
+ "account"
+ ],
+ pageCreator: () => {
+ return new PageAccount(store);
+ }
+ };
+}
+
+@customElement("page-account")
+class PageAccount<S extends AppStateKeyed> extends Page<S> {
+
+ static get styles() {
+ // language=CSS
+ return css`
+ iframe {
+ width: 100%;
+ }
+ `;
+ }
+
+ constructor(store: EnhancedStore<S>) {
+ super(store);
+ }
+
+ protected render(): TemplateResult | void {
+
+ if (!manager.authenticated) {
+ return html`
+ <or-translate value="notAuthenticated"></or-translate>
+ `;
+ }
+
+ if (!manager.isKeycloak()) {
+ return html`
+ <or-translate value="notSupported"></or-translate>
+ `;
+ }
+
+ return html`
+ <iframe .src="${manager.keycloakUrl + "/realms/" + manager.getRealm() + "/account/"}"></iframe>
+ `;
+ }
+
+ public stateChanged(state: S) {
+ }
+}
diff --git a/ui/component/core/src/index.ts b/ui/component/core/src/index.ts
index 0900e1e64..4e7b99054 100644
--- a/ui/component/core/src/index.ts
+++ b/ui/component/core/src/index.ts
@@ -395,6 +395,14 @@ export class Manager implements EventProviderFactory {
return this._managerVersion && this._managerVersion !== "";
}
+ get managerUrl() {
+ return this._config.managerUrl;
+ }
+
+ get keycloakUrl() {
+ return this._config.keycloakUrl;
+ }
+
get isError() {
return !!this._error;
}
@@ -984,6 +992,10 @@ export class Manager implements EventProviderFactory {
return this.console && this.console.isMobile;
}
+ public isKeycloak(): boolean {
+ return !!this._keycloak;
+ }
+
protected _onAuthenticated() {
// If native shell is enabled, we need an offline refresh token
if (this.console && this.console.isMobile && this.config.auth === Auth.KEYCLOAK) {
diff --git a/ui/keycloak/themes/openremote/account/account.ftl b/ui/keycloak/themes/openremote/account/account.ftl
index d482f17ba..3b14ca657 100644
--- a/ui/keycloak/themes/openremote/account/account.ftl
+++ b/ui/keycloak/themes/openremote/account/account.ftl
@@ -1,4 +1,4 @@
-<#import "template.ftl" as layout>
+ <#import "template.ftl" as layout>
<@layout.mainLayout active='account'; section>
<h4>${msg("editAccountHtmlTitle")}</h4>
diff --git a/ui/keycloak/themes/openremote/account/resources/css/styles.css b/ui/keycloak/themes/openremote/account/resources/css/styles.css
index 3d4ed3035..04d364464 100644
--- a/ui/keycloak/themes/openremote/account/resources/css/styles.css
+++ b/ui/keycloak/themes/openremote/account/resources/css/styles.css
@@ -8,7 +8,6 @@
html, body {
margin: 0;
padding: 0;
- height: 100vh;
background-color: var(--app-background-color);
}