From e325ad10dd0c7557f7e44a16e6d2d82e000e1c49 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Mon, 18 Feb 2019 16:18:48 +1300 Subject: [PATCH] fix(oauth): fix an UX issue when updating microsoft oauth settings --- .../oauth-settings/oauth-settings-controller.js | 10 +++++++++- .../components/oauth-settings/oauth-settings.html | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/extensions/oauth/components/oauth-settings/oauth-settings-controller.js b/app/extensions/oauth/components/oauth-settings/oauth-settings-controller.js index c5015b5e8..c6808ebf0 100644 --- a/app/extensions/oauth/components/oauth-settings/oauth-settings-controller.js +++ b/app/extensions/oauth/components/oauth-settings/oauth-settings-controller.js @@ -37,6 +37,14 @@ angular.module('portainer.extensions.oauth') if (ctrl.settings.RedirectURI === '') { ctrl.settings.RedirectURI = window.location.origin; } - ctrl.state.provider.authUrl = ctrl.settings.AuthorizationURI; + if (ctrl.settings.AuthorizationURI !== '') { + ctrl.state.provider.authUrl = ctrl.settings.AuthorizationURI; + + if (ctrl.settings.AuthorizationURI.indexOf('login.microsoftonline.com') > -1) { + var tenantID = ctrl.settings.AuthorizationURI.match(/login.microsoftonline.com\/(.*?)\//)[1]; + ctrl.state.microsoftTenantID = tenantID; + onMicrosoftTenantIDChange(); + } + } } }); diff --git a/app/extensions/oauth/components/oauth-settings/oauth-settings.html b/app/extensions/oauth/components/oauth-settings/oauth-settings.html index e6f5e13e8..7a9593f6a 100644 --- a/app/extensions/oauth/components/oauth-settings/oauth-settings.html +++ b/app/extensions/oauth/components/oauth-settings/oauth-settings.html @@ -18,7 +18,8 @@
- The users created by the automatic provisioning feature can be added to a default team on creation. This setting is optional. +

The users created by the automatic provisioning feature can be added to a default team on creation.

+

By assigning newly created users to a team they will be able to access the environments associated to that team. This setting is optional and if not set newly created users won't be able to access any environments.