From 9fd6145605242b68dcad486743183df9732cdc00 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 9 Dec 2016 17:34:56 +0530 Subject: [PATCH 1/3] Fixing SSO issue --- .../devicemgt/app/pages/cdmf.page.sign-in/sign-in.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js index df49bf1d044..dfc08774820 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js @@ -1,5 +1,4 @@ function onRequest(context) { - var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; var authModuleConfigs = context.app.conf["authModule"]; var sessionDataKey = request.getParameter("sessionDataKey"); @@ -19,7 +18,7 @@ function onRequest(context) { var viewModel = {}; var loginActionUrl = context.app.context + "/uuf/login"; if (sessionDataKey) { - loginActionUrl = devicemgtProps["httpsURL"] + "/commonauth"; + loginActionUrl = "/commonauth"; } viewModel.sessionDataKey = sessionDataKey; From c2847321923acc15926c18ed329c8c9ab5380e09 Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 9 Dec 2016 18:22:09 +0530 Subject: [PATCH 2/3] Displaying SSO auth failure messages --- .../devicemgt/app/pages/cdmf.page.sign-in/sign-in.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js index dfc08774820..cea0fc2d7b7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js @@ -1,6 +1,7 @@ function onRequest(context) { var authModuleConfigs = context.app.conf["authModule"]; var sessionDataKey = request.getParameter("sessionDataKey"); + var authFailure = request.getParameter("authFailure"); //if sso enabled and sessionDataKey is empty redirect var ssoConfigs = authModuleConfigs["sso"]; @@ -18,7 +19,11 @@ function onRequest(context) { var viewModel = {}; var loginActionUrl = context.app.context + "/uuf/login"; if (sessionDataKey) { - loginActionUrl = "/commonauth"; + loginActionUrl = "/commonauth"; + } + + if(authFailure){ + viewModel.message = "Login failed! Please recheck the username and password and try again."; } viewModel.sessionDataKey = sessionDataKey; From 1bee155d9a704df49c61ad75af2304b2e3b79cdf Mon Sep 17 00:00:00 2001 From: Rasika Perera Date: Fri, 9 Dec 2016 19:06:00 +0530 Subject: [PATCH 3/3] Fixing formatting issue --- .../devicemgt/app/pages/cdmf.page.sign-in/sign-in.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js index cea0fc2d7b7..627791eebbe 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.sign-in/sign-in.js @@ -22,7 +22,7 @@ function onRequest(context) { loginActionUrl = "/commonauth"; } - if(authFailure){ + if (authFailure) { viewModel.message = "Login failed! Please recheck the username and password and try again."; }