*/
private Authentication generalUserRequest(ServletRequest servletRequest, ServletResponse servletResponse, boolean mandatory)
throws IOException, ServerAuthException {
//only perform SAML Authentication if it is mandatory
if(!mandatory){
Request request = (Request) servletRequest;
return request.getAuthentication();
}
ServiceProviderSAMLWorkflow serviceProviderSAMLWorkflow = new ServiceProviderSAMLWorkflow();
serviceProviderSAMLWorkflow.setRedirectionHandler(new JettyRedirectionHandler());
HttpServletRequest request = (HttpServletRequest) servletRequest;
HttpServletResponse response = (HttpServletResponse) servletResponse;
HttpSession session = request.getSession(false);
boolean willSendRequest = false;
HTTPContext httpContext = new HTTPContext(request, response, theServletContext);
Set<SAML2Handler> handlers = chain.handlers();