From 708a60ad63459f289173f1ad08edf82f9b088821 Mon Sep 17 00:00:00 2001 From: Jan Date: Wed, 20 Sep 2023 09:12:26 +0200 Subject: [PATCH 1/3] load login url from config --- .../enhancement-make-login-url-configurable | 7 ++++ docs/getting-started.md | 4 +++ packages/web-pkg/src/configuration/manager.ts | 1 + packages/web-pkg/src/configuration/types.ts | 1 + .../web-runtime/src/pages/accessDenied.vue | 35 ++++++++++++++----- 5 files changed, 39 insertions(+), 9 deletions(-) create mode 100644 changelog/unreleased/enhancement-make-login-url-configurable diff --git a/changelog/unreleased/enhancement-make-login-url-configurable b/changelog/unreleased/enhancement-make-login-url-configurable new file mode 100644 index 00000000000..8c4cc14a6fa --- /dev/null +++ b/changelog/unreleased/enhancement-make-login-url-configurable @@ -0,0 +1,7 @@ +Enhancement: Make login url configurable + +We've added a new configuration option loginUrl to web, this is helpful if you use an external IdP and the login +is out of web/OCIS context. + +https://github.com/owncloud/ocis/pull/7317 +https://github.com/owncloud/web/issues/9707 diff --git a/docs/getting-started.md b/docs/getting-started.md index 9bd27eb20e3..31c1c0d17f8 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -76,6 +76,10 @@ Depending on the backend you are using, there are sample config files provided i - `options.contextHelpersReadMore` Specifies whether the "Read more" link should be displayed or not. - `options.openLinksWithDefaultApp` Specifies whether single file link shares should be opened with default app or not. - `options.tokenStorageLocal` Specifies whether the access token will be stored in the local storage when set to `true` or in the session storage when set to `false`. If stored in the local storage, login state will be persisted across multiple browser tabs, means no additional logins are required. Defaults to `true`. +- `options.loginUrl` Specifies the target URL to the login page. This is helpful when an external IdP is used. This option is disabled by default. Example URL like: 'https://www.myidp.com/login'. +- `options.logoutUrl` Adds a link to the user's profile page to point him to an external page, where he can manage his session and devices. This is helpful when an external IdP is used. This option is disabled by default. +- `options.imprintUrl` Specifies the target URL for the imprint link valid for the ocis instance in the account menu. +- `options.privacyUrl` Specifies the target URL for the privacy link valid for the ocis instance in the account menu. #### Scripts and Styles diff --git a/packages/web-pkg/src/configuration/manager.ts b/packages/web-pkg/src/configuration/manager.ts index 1b8ddfb7fbb..29873f68c4e 100644 --- a/packages/web-pkg/src/configuration/manager.ts +++ b/packages/web-pkg/src/configuration/manager.ts @@ -98,6 +98,7 @@ export class ConfigurationManager { ) set(this.optionsConfiguration, 'upload.companionUrl', get(options, 'upload.companionUrl', '')) set(this.optionsConfiguration, 'tokenStorageLocal', get(options, 'tokenStorageLocal', true)) + set(this.optionsConfiguration, 'loginUrl', get(options, 'loginUrl', '')) } get options(): OptionsConfiguration { diff --git a/packages/web-pkg/src/configuration/types.ts b/packages/web-pkg/src/configuration/types.ts index 3f3f6e4eda4..bb352c3fa92 100644 --- a/packages/web-pkg/src/configuration/types.ts +++ b/packages/web-pkg/src/configuration/types.ts @@ -18,6 +18,7 @@ export interface OptionsConfiguration { routing?: RoutingOptionsConfiguration upload?: UploadOptionsConfiguration logoutUrl?: string + loginUrl?: string contextHelpersReadMore?: boolean contextHelpers?: boolean openAppsInTab?: boolean diff --git a/packages/web-runtime/src/pages/accessDenied.vue b/packages/web-runtime/src/pages/accessDenied.vue index c5af8ea63f0..67d77cf5114 100644 --- a/packages/web-runtime/src/pages/accessDenied.vue +++ b/packages/web-runtime/src/pages/accessDenied.vue @@ -22,12 +22,11 @@ @@ -35,14 +34,16 @@