void invokeChainWithRemoteUser(
     FilterChain chain,
     HttpServletRequest httpRequest,
     HttpServletResponse httpResponse,
     SAMLAssertion assertion)
     throws IOException, ServletException {
   // set assertion as an attribute in the request
   try {
     httpRequest.setAttribute(
         ACS_SAML, Utils.getXMLStringFromNode(assertion.getAssertionXMLElement()));
   } catch (Exception e) {
     Utils.logError("Invalid Saml Content.", e, LOG);
     throw new ServletException("Invalid SAML Content");
   }
   String remoteUser = getUserFromAssertion(assertion);
   invokeChainWithRemoteUser(chain, httpRequest, httpResponse, remoteUser);
 }