IDEMPIERE-5346 SSO Support (#2046)

- Fix change role exception
- Fix SSO breaking -H "X-PING: true"
This commit is contained in:
hengsin 2023-10-05 13:31:37 +08:00 committed by GitHub
parent c4e7e0abaa
commit 5506aa7ae4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 9 deletions

View File

@ -65,6 +65,14 @@ public class SSOWebUIFilter implements Filter
HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletRequest httpRequest = (HttpServletRequest) request;
HttpServletResponse httpResponse = (HttpServletResponse) response; 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 // Ignore the resource request
if (SSOUtils.isResourceRequest(httpRequest, true)) if (SSOUtils.isResourceRequest(httpRequest, true))
{ {

View File

@ -211,15 +211,7 @@ public class LoginWindow extends Window implements EventListener<Event>
pnlRole = new RolePanel(ctx, this, userName, show, clientsKNPairs, isClientDefined); pnlRole = new RolePanel(ctx, this, userName, show, clientsKNPairs, isClientDefined);
if (isSSOLogin) if (isSSOLogin)
{ {
this.addEventListener(SSOUtils.EVENT_ON_AFTER_SSOLOGIN, new EventListener<Event>() { Executions.schedule(getDesktop(), e -> validateMFPanel(userName, show, clientsKNPairs, isClientDefined), new Event(SSOUtils.EVENT_ON_AFTER_SSOLOGIN));
@Override
public void onEvent(Event arg0) throws Exception
{
validateMFPanel(userName, show, clientsKNPairs, isClientDefined);
}
});
Events.echoEvent(SSOUtils.EVENT_ON_AFTER_SSOLOGIN, this, null);
} }
else else
{ {