From 5506aa7ae42d126549d490b65cc947c767f9981b Mon Sep 17 00:00:00 2001 From: hengsin Date: Thu, 5 Oct 2023 13:31:37 +0800 Subject: [PATCH] IDEMPIERE-5346 SSO Support (#2046) - Fix change role exception - Fix SSO breaking -H "X-PING: true" --- .../org/adempiere/webui/sso/filter/SSOWebUIFilter.java | 8 ++++++++ .../src/org/adempiere/webui/window/LoginWindow.java | 10 +--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/sso/filter/SSOWebUIFilter.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/sso/filter/SSOWebUIFilter.java index 49ae97723c..7167a33749 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/sso/filter/SSOWebUIFilter.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/sso/filter/SSOWebUIFilter.java @@ -65,6 +65,14 @@ public class SSOWebUIFilter implements Filter HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; + //handle ping request + String ping = httpRequest.getHeader("X-PING"); + if (!Util.isEmpty(ping, true)) + { + chain.doFilter(request, response); + return; + } + // Ignore the resource request if (SSOUtils.isResourceRequest(httpRequest, true)) { diff --git a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/LoginWindow.java b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/LoginWindow.java index 91e491cc7c..669d4ba8c8 100644 --- a/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/LoginWindow.java +++ b/org.adempiere.ui.zk/WEB-INF/src/org/adempiere/webui/window/LoginWindow.java @@ -211,15 +211,7 @@ public class LoginWindow extends Window implements EventListener pnlRole = new RolePanel(ctx, this, userName, show, clientsKNPairs, isClientDefined); if (isSSOLogin) { - this.addEventListener(SSOUtils.EVENT_ON_AFTER_SSOLOGIN, new EventListener() { - - @Override - public void onEvent(Event arg0) throws Exception - { - validateMFPanel(userName, show, clientsKNPairs, isClientDefined); - } - }); - Events.echoEvent(SSOUtils.EVENT_ON_AFTER_SSOLOGIN, this, null); + Executions.schedule(getDesktop(), e -> validateMFPanel(userName, show, clientsKNPairs, isClientDefined), new Event(SSOUtils.EVENT_ON_AFTER_SSOLOGIN)); } else {