WSPRedirectHandlerServlet.java revision 195685d773ad5f35ed22b75908856f7aa7066355
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved * The contents of this file are subject to the terms * of the Common Development and Distribution License * (the License). You may not use this file except in * compliance with the License. * You can obtain a copy of the License at * See the License for the specific language governing * permission and limitations under the License. * When distributing Covered Code, include this CDDL * Header Notice in each file and include the License file * If applicable, add the following below the CDDL Header, * with the fields enclosed by brackets [] replaced by * your own identifying information: * "Portions Copyrighted [year] [name of copyright owner]" * Portions Copyrighted 2012-2014 ForgeRock AS * Class that works in conjection with InteractionManager to facilitate * WSP- resource owner interactions //testXSL(httpRequest, httpResponse); "WSPRedirectHandlerServlet.handleRequest():" //check for trusted handlers "WSPRedirectHandlerServlet.handleRequest():" +
"denied attempt to forward to untrusted host id:" "WSPRedirectHandlerServlet.handleRequest()" "WSPRedirectHandlerServlet.handleRequest():" +
"processing request in the local server");
"WSPRedirectHandlerServlet.handleRequest():entering " "WSPRedirecthandlerServlet.handleRequest():" //returnToURL should not have ResendMessage parameter "WSPRedirecthandlerServlet.handleRequest():" +
"invalid Request - illegal parameter:" "Invalid Request - illegal parameter:" //returnToURL should be https "WSPRedirecthandlerServlet.handleRequest():" //returnToURL should point to requestHost "WSPRedirecthandlerServlet.handleRequest():" +
"Invalid Request ReturnToHost differs from " "Invalid Request ReturnToHost differs from " //save returnToURL against messageID in InteractionManager }
else {
//no returnToURL, response submission "WSPRedirecthandlerServlet.handleRequest():" +
" entering without retunrnToRL:" +
" response for query");
//get returnToURL against messageID in InteractionManager "WSPRedirecthandlerServlet.handleRequest():" +
" returnToURL, cacheEntry " +
" not found to redirect, for TransactionID : " " returnToURL not found in cache");
"WSPRedirecthandlerServlet.handleRequest():" +
"request without messageID" "Invalid Request - missing messageID" "WSPRedirecthandlerServlet.handleRequest():returning");
* Constructs an HTML/WML page from InteractionQuery using * an XSL stylesheet and sends the page to browser. // generate html page, with action url pointing back to this servlet // set query parameters transID and responseID "WSPRedirectHandlerServlet.sendInteractionRequestPage():" if (!
wmlClient) {
//not a wmlClient, assume html client +
"sendInteractionRequestPage():" +
"sendInteractionRequestPage():" "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"");
//style inquiryElement and send it to browser "com.sun.identity.liberty.ws.interaction.jaxb");
"WSPRedirectHandlerServlet.sendInteractionRequestPage():" +
"catching JAXBException =",
je);
"Error creating JAXBObject:" "WSPRedirectHandlerServlet.sendInteractionRequestPage():" +
"catching ParserConfigurationException =",
pce);
"Error creating interaction request page:" "WSPRedirectHandlerServlet.sendInteractionRequestPage():" +
"catching TransformerException =",
tce);
"Error creating interaction request page:" "WSPRedirectHandlerServlet.sendInteractionResponsePage():" //read and save query parameters; ParameterType parameterType = JAXBObjectFactory.getObjectFactory() +
".sendInteractionResponsePage():" //store InteractionResponse in interaction manager; "WSPRedirectHandlerServlet." +
" sendInteractionResponsePage():" +
"redirecting user agent to returnToURL=" "WSPRedirectHandlerServlet.sendInteractionResponsePage():" +
"catching JAXBException =",
je);
"Error createing JAXBObject:" "WSPRedirectHandlerServlet.sendInteractionResponsePage():" +
"catching Exception =", e);
out.
println(
"<head><title>WSPRedirectHandler</title></head>");
out.
println(
"WSPRedirectHandler - Interaction Error");
out.
println(
"WSPRediretHandler - encountered error");
"WSPRedirecthandlerServlet.handleRequest():" //requestHost does not include domain under jdk1.3 "WSPRedirectHandlerServlet.checkReturnToHost():" // TODO: need to find a way to detect client "WSPRedirectHandlerServlet.forwardRequest():" byte[]
buffer =
new byte[
1024];
if ( (i != -
1) && (j !=-
1) ) {
+
"exception in finally block:", e);
"WSPRedirectHandlerServlet.sendErrorPageUntrustedHost()");
out.
println(
"<title>Denied attempt to forward to untrusted server" +
i18n.
getString(
"denied_attemtpt_to_forward_to_untrusted_server")