+ |
+ |
+ |
You are now redirected back to " + Encode.forHtmlContent(acUrl)); + out.println(" If the redirection fails, please click the post button.
"); + out.println(""); + out.println(""); + out.println(""); + out.println(""); + } + + private void generateSamlPostPageFromFile(HttpServletResponse resp, String acUrl, String samlMessage, + String relayState, String authenticatedIdPs, String samlMessageType) + throws IOException { + + String finalPage; + String htmlPage = IdentitySAMLSSOServiceComponent.getSsoRedirectHtml(); + String pageWithAcs = htmlPage.replace("$acUrl", acUrl); + String pageWithAcsResponse = pageWithAcs.replace("", + buildPostPageInputs(samlMessageType, samlMessage)); + String pageWithAcsResponseRelay = pageWithAcsResponse; + + if (relayState != null) { + pageWithAcsResponseRelay = pageWithAcsResponse.replace("", + buildPostPageInputs(SAMLSSOConstants.RELAY_STATE, relayState)); + } + if (authenticatedIdPs == null || authenticatedIdPs.isEmpty()) { + finalPage = pageWithAcsResponseRelay; } else { - PrintWriter out = resp.getWriter(); - out.println(""); - out.println(""); - out.println("You are now redirected back to " + Encode.forHtmlContent(acUrl)); - out.println(" If the redirection fails, please click the post button.
"); - out.println(""); - out.println(""); - out.println(""); - out.println(""); + if (log.isDebugEnabled()) { + log.debug("samlsso_response.html " + finalPage); } } @@ -1012,49 +1225,108 @@ private void handleAuthenticationReponseFromFramework(HttpServletRequest req, Ht } } - private void handleLogoutResponseFromFramework(HttpServletRequest request, - HttpServletResponse response, SAMLSSOSessionDTO sessionDTO) + private void handleLogoutResponseFromFramework(HttpServletRequest request, HttpServletResponse response, + SAMLSSOSessionDTO sessionDTO) throws ServletException, IOException, IdentityException { SAMLSSOReqValidationResponseDTO validationResponseDTO = sessionDTO.getValidationRespDTO(); if (validationResponseDTO != null) { removeSessionDataFromCache(request.getParameter(SAMLSSOConstants.SESSION_DATA_KEY)); - - if ( SSOSessionPersistenceManager.getSessionIndexFromCache(sessionDTO.getSessionId()) == null) { - // remove tokenId Cookie when there is no session available. - removeTokenIdCookie(request, response); + boolean isPost = (boolean) sessionDTO.getProperties().get(SAMLSSOConstants.IS_POST); + String sessionIndex = extractSessionIndex(request, validationResponseDTO.isIdPInitSLO(), + sessionDTO.getSessionId(), isPost); + List