Skip to content

armgit / core

Public Imported from GitHub
0

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

Fix for role mapping. When LDAP is used, openremote can be missing

Michael Rademaker2487b392088a
diff --git a/ui/component/core/src/index.ts b/ui/component/core/src/index.ts
index cf9684692..55ffeb4fa 100644
--- a/ui/component/core/src/index.ts
+++ b/ui/component/core/src/index.ts
@@ -717,7 +717,11 @@ export class Manager implements EventProviderFactory {
this._name = this._keycloak.tokenParsed.name;
this._username = this._keycloak.tokenParsed.preferred_username;
- this._roles = this._keycloak.resourceAccess.openremote.roles;
+ if (this._keycloak.resourceAccess.openremote) {
+ this._roles = this._keycloak.resourceAccess.openremote.roles;
+ } else {
+ this._roles = this._keycloak.resourceAccess.account.roles;
+ }
// Update the access token every 10s (note keycloak will only update if expiring within configured
// time period.