@Override
    @SneakyThrows
    @SuppressWarnings("LineLength")
    protected void executeChain(ServletRequest request, ServletResponse response,
            FilterChain origChain) throws IOException, ServletException {
        if (isShiroEEDisabled(getServletContext())) {
            origChain.doFilter(request, response);
        } else if (Boolean.TRUE.equals(request.getAttribute(FORM_IS_RESUBMITTED)) && isPostRequest(request)) {
            // See https://stackoverflow.com/questions/7643484/how-to-get-rid-of-warning-pwc4011-unable-to-set-request-character-encoding-to
            request.setCharacterEncoding(StandardCharsets.UTF_8.name());
            request.removeAttribute(FORM_IS_RESUBMITTED);
            String postData = getPostData(request);
            log.debug("Resubmitting Post Data: {}", postData);
            var httpRequest = WebUtils.toHttp(request);
            boolean rememberedAjaxResubmit = "partial/ajax".equals(httpRequest.getHeader("Faces-Request"));
            Optional.ofNullable(resubmitSavedForm(postData,
                    Servlets.getRequestURLWithQueryString(httpRequest),
                    WebUtils.toHttp(request), WebUtils.toHttp(response),
                    request.getServletContext(), rememberedAjaxResubmit))
                    .ifPresent(url -> sendRedirect(response, url));
        } else {
            // See https://stackoverflow.com/questions/7643484/how-to-get-rid-of-warning-pwc4011-unable-to-set-request-character-encoding-to
            request.setCharacterEncoding(StandardCharsets.UTF_8.name());
            super.executeChain(request, response, origChain);
        }
    }
Stops JEE server from interpreting Shiro principal as direct EJB principal,
this has sideffects of trying to log in to remote EJBs with the credentials from Shiro,
which isn't what this meant to do, as it's meant to just transfer Shiro credentials
to remote EJB call site.

Thus, force null EJB principal for the web session,
as the real principal comes from the EjbSecurityFilter's doAs() call

Also handles X-Forwarded-Proto support
support/jakarta-ee/src/main/java/org/apache/shiro/ee/filters/ShiroFilter.java