From d73b2f283f292573a3bbe3a27c68fa5362e4b9d7 Mon Sep 17 00:00:00 2001
From: Christoph Reiter <reiter.christoph@gmail.com>
Date: Wed, 24 Jun 2020 16:36:13 +0200
Subject: [PATCH] Adjust for vpu-auth changes

---
 packages/app-shell/README.md        | 2 +-
 packages/app-shell/src/app-shell.js | 8 +++++---
 packages/app-shell/vendor/auth      | 2 +-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/packages/app-shell/README.md b/packages/app-shell/README.md
index 9b4faf81..dd8f2cbe 100644
--- a/packages/app-shell/README.md
+++ b/packages/app-shell/README.md
@@ -18,7 +18,7 @@ activities. Handles login, language selection, activity switching, menus etc.
 - `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
+- `keycloak-config`: An object with the following keys: url, realm, clientId, silentCheckSsoRedirectUri, scope
 
 ## Topic Metadata
 
diff --git a/packages/app-shell/src/app-shell.js b/packages/app-shell/src/app-shell.js
index f5a52640..f63d3be5 100644
--- a/packages/app-shell/src/app-shell.js
+++ b/packages/app-shell/src/app-shell.js
@@ -3,7 +3,7 @@ import {html, css, LitElement} from 'lit-element';
 import {ScopedElementsMixin} from '@open-wc/scoped-elements';
 import {LanguageSelect} from 'vpu-language-select';
 import {Icon, EventBus} from 'vpu-common';
-import {Auth} from 'vpu-auth';
+import {AuthKeycloak} from 'vpu-auth';
 import {AuthMenuButton} from './auth-menu-button.js';
 import {Notification} from 'vpu-notification';
 import * as commonStyles from 'vpu-common/styles';
@@ -66,7 +66,7 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
           'vpu-language-select': LanguageSelect,
           'vpu-tugraz-logo': TUGrazLogo,
           'vpu-build-info': BuildInfo,
-          'vpu-auth': Auth,
+          'vpu-auth-keycloak': AuthKeycloak,
           'vpu-auth-menu-button': AuthMenuButton,
           'vpu-notification': Notification,
           'vpu-icon': Icon,
@@ -708,9 +708,11 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
             "https://www.tugraz.at/en/about-this-page/legal-notice/" :
             "https://www.tugraz.at/ueber-diese-seite/impressum/";
 
+        const kc = this.keycloakConfig;
+
         return html`
             <slot class="${slotClassMap}"></slot>
-            <vpu-auth lang="${this.lang}" keycloak-config="${JSON.stringify(this.keycloakConfig)}" load-person try-login></vpu-auth>
+            <vpu-auth-keycloak lang="${this.lang}" url="${kc.url}" realm="${kc.realm}" client-id="${kc.clientId}" silent-check-sso-redirect-uri="${kc.silentCheckSsoRedirectUri || ''}" scope="${kc.scope || ''}" load-person try-login></vpu-auth-keycloak>
             <div class="${mainClassMap}">
             <div id="main">
                 <vpu-notification lang="${this.lang}"></vpu-notification>
diff --git a/packages/app-shell/vendor/auth b/packages/app-shell/vendor/auth
index 46cecbc4..3d9165d8 160000
--- a/packages/app-shell/vendor/auth
+++ b/packages/app-shell/vendor/auth
@@ -1 +1 @@
-Subproject commit 46cecbc422e0c25ff9b0336c2c1bd7083117306f
+Subproject commit 3d9165d8e688e0cf85ff8686e6bcd75733808390
-- 
GitLab