From 2211a358968aed88afb49ff93acc6eaaea04476f Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Thu, 30 Apr 2020 16:50:49 +0200
Subject: [PATCH] Revert "Add a keycloak-config attribute and forward it to
 vpu-auth"

This reverts commit 299dfdded2b3a56a9e666e70c301c7408e570eba.
---
 packages/app-shell/README.md        | 3 +--
 packages/app-shell/src/app-shell.js | 9 +++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/packages/app-shell/README.md b/packages/app-shell/README.md
index dfb036c0..9d9543de 100644
--- a/packages/app-shell/README.md
+++ b/packages/app-shell/README.md
@@ -14,11 +14,10 @@ activities. Handles login, language selection, activity switching, menus etc.
 ## Attributes
 
 - `lang` (optional, default: `de`): set to `de` or `en` for German or English
-    - example `<vpu-app-shell lang="de" </vpu-app-shell>`
+    - example `<vpu-auth lang="de" </vpu-auth>`
 - `src`: The path to a topic metadata file (json)
 - `base-path` (optional, default: `/`: An absolute base path for routing
 - `entry-point-url`: Entry point URL to access the API
-- `keycloak-config`: See `vpu-auth` for details
 
 ## Topic Metadata
 
diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js
index 3117a1f2..2c9ef61e 100644
--- a/packages/app-shell/src/app-shell.js
+++ b/packages/app-shell/src/app-shell.js
@@ -5,6 +5,7 @@ import {LanguageSelect} from 'vpu-language-select';
 import {Icon} from 'vpu-common';
 import {Auth} from 'vpu-auth';
 import {Notification} from 'vpu-notification';
+import * as commonUtils from 'vpu-common/utils';
 import * as commonStyles from 'vpu-common/styles';
 import buildinfo from 'consts:buildinfo';
 import {classMap} from 'lit-html/directives/class-map.js';
@@ -46,14 +47,13 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
         super();
         this.lang = i18n.language;
         this.activeView = '';
-        this.entryPointUrl = '';
+        this.entryPointUrl = commonUtils.getAPiUrl();
         this.subtitle = '';
         this.description = '';
         this.routes = [];
         this.metadata = {};
         this.topic = {};
         this.basePath = '/';
-        this.keycloakConfig = null;
 
         this._updateAuth = this._updateAuth.bind(this);
         this._loginStatus = 'unknown';
@@ -218,7 +218,6 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
             basePath: { type: String, attribute: 'base-path' },
             activeView: { type: String, attribute: false},
             entryPointUrl: { type: String, attribute: 'entry-point-url' },
-            keycloakConfig: { type: Object, attribute: 'keycloak-config' },
             metadata: { type: Object, attribute: false },
             topic: { type: Object, attribute: false },
             subtitle: { type: String, attribute: false },
@@ -638,6 +637,8 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
     }
 
     render() {
+        const silentCheckSsoUri = commonUtils.getAssetURL('silent-check-sso.html');
+
         const getSelectClasses = (name => {
             return classMap({selected: this.activeView === name});
         });
@@ -684,7 +685,7 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
                     <div class="hd1-middle">
                     </div>
                     <div class="hd1-right">
-                        <vpu-auth lang="${this.lang}" show-profile keycloak-config="${JSON.stringify(this.keycloakConfig)}" load-person try-login></vpu-auth>
+                        <vpu-auth lang="${this.lang}" show-profile keycloak-config='{"clientId": "${commonUtils.setting('keyCloakClientId')}", "silentCheckSsoRedirectUri": "${silentCheckSsoUri}"}' load-person try-login></vpu-auth>
                     </div>
                     <div class="hd2-left">
                         <div class="header">
-- 
GitLab