Skip to content
Snippets Groups Projects
Commit c22dc6da authored by Reiter, Christoph's avatar Reiter, Christoph :snake:
Browse files

Try again: Add attribute for forwarding the keycloak config

No longer depend on env.js to select the right config but require it
to be passed explicitely in the attributes.
parent 2211a358
No related branches found
No related tags found
No related merge requests found
......@@ -14,10 +14,11 @@ 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-auth lang="de" </vpu-auth>`
- example `<vpu-app-shell lang="de" </vpu-app-shell>`
- `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
......
......@@ -15,7 +15,7 @@
<body>
<vpu-app-shell src="/example.topic.metadata.json"></vpu-app-shell>
<vpu-app-shell keycloak-config='{"url": "https://auth-dev.tugraz.at/auth", "realm": "tugraz", "clientId": "auth-dev-mw-frontend-local", "silentCheckSsoRedirectUri": "/silent-check-sso.html"}' src="/example.topic.metadata.json"></vpu-app-shell>
</body>
</html>
\ No newline at end of file
......@@ -5,8 +5,8 @@ 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 * as commonUtils from 'vpu-common/utils';
import buildinfo from 'consts:buildinfo';
import {classMap} from 'lit-html/directives/class-map.js';
import {Router} from './router.js';
......@@ -54,6 +54,7 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
this.metadata = {};
this.topic = {};
this.basePath = '/';
this.keycloakConfig = null;
this._updateAuth = this._updateAuth.bind(this);
this._loginStatus = 'unknown';
......@@ -218,6 +219,7 @@ 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 },
......@@ -637,8 +639,6 @@ export class AppShell extends ScopedElementsMixin(LitElement) {
}
render() {
const silentCheckSsoUri = commonUtils.getAssetURL('silent-check-sso.html');
const getSelectClasses = (name => {
return classMap({selected: this.activeView === name});
});
......@@ -685,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='{"clientId": "${commonUtils.setting('keyCloakClientId')}", "silentCheckSsoRedirectUri": "${silentCheckSsoUri}"}' load-person try-login></vpu-auth>
<vpu-auth lang="${this.lang}" show-profile keycloak-config="${JSON.stringify(this.keycloakConfig)}" load-person try-login></vpu-auth>
</div>
<div class="hd2-left">
<div class="header">
......
......@@ -48,7 +48,7 @@ class AppShellUserProfile extends ScopedElementsMixin(LitElement) {
render() {
return html`
<vpu-person-profile value="${this._personId}" entry-point-url="${this.entryPointUrl}"" lang="${this.lang}"></vpu-person-profile>
<vpu-person-profile value="${this._personId}" entry-point-url="${this.entryPointUrl}" lang="${this.lang}"></vpu-person-profile>
`;
}
}
......
auth @ 2e179331
Subproject commit b9fbe487a8a6117ae90a423a8ba318a0321bf51b
Subproject commit 2e179331c2f7572a85e98c825736a3c93494e1ea
person-profile @ 5cb9000f
Subproject commit 8158d8451e08bfaf495ee263d208a448df83e12d
Subproject commit 5cb9000f7ae43558b3db7df4b61f3bb177f02fe2
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment