idpMNIPOST.jsp revision 0fdab8904a8fe223f6934b878769fe45e7651c60
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%--
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China Copyright (c) 2008 Sun Microsystems Inc. All Rights Reserved
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China The contents of this file are subject to the terms
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China of the Common Development and Distribution License
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China (the License). You may not use this file except in
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China compliance with the License.
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China You can obtain a copy of the License at
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China https://opensso.dev.java.net/public/CDDLv1.0.html or
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China opensso/legal/CDDLv1.0.txt
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China See the License for the specific language governing
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China permission and limitations under the License.
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China When distributing Covered Code, include this CDDL
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China Header Notice in each file and include the License file
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China at opensso/legal/CDDLv1.0.txt.
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China If applicable, add the following below the CDDL Header,
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China with the fields enclosed by brackets [] replaced by
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China your own identifying information:
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China "Portions Copyrighted [year] [name of copyright owner]"
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China $Id: idpMNIPOST.jsp,v 1.5 2009/06/24 23:05:30 mrudulahg Exp $
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China--%>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%--
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China Portions Copyrighted 2013 ForgeRock AS
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China--%>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%@ page import="com.sun.identity.saml2.common.SAML2Constants" %>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%@ page import="com.sun.identity.saml2.common.SAML2Utils" %>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%@ page import="com.sun.identity.saml.common.SAMLUtils" %>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%@ page import="com.sun.identity.saml2.profile.DoManageNameID" %>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%@ page import="java.util.HashMap" %>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%@ page import="org.owasp.esapi.ESAPI" %>
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China<%--
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China idpMNIHTTPRedirect.jsp processes the ManageNameIDRequest from
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China the Service Provider with HttpRedirect binding.
aecfc01d1bad84e66649703f7fc2926ef70b34barui zang - Sun Microsystems - Beijing China Required parameters to this jsp are : NONE
--%>
<%
try {
HashMap paramsMap = new HashMap();
paramsMap.put(SAML2Constants.ROLE, SAML2Constants.IDP_ROLE);
String samlRequest = request.getParameter(SAML2Constants.SAML_REQUEST);
String samlResponse =
request.getParameter(SAML2Constants.SAML_RESPONSE);
if (samlRequest != null) {
DoManageNameID.processPOSTRequest(request, response, paramsMap);
}
if (samlResponse != null) {
boolean success = DoManageNameID.processMNIResponsePOST(request,
response, paramsMap);
if (success == true) {
String relayState = request.getParameter(SAML2Constants.RELAY_STATE);
if (!ESAPI.validator().isValidInput("HTTP Parameter Value: " + relayState, relayState, "URL", 2000, true)) {
relayState = null;
}
if (relayState != null && SAML2Utils.isRelayStateURLValid(request, relayState, SAML2Constants.IDP_ROLE)) {
response.sendRedirect(relayState);
} else {
%>
<jsp:forward
page="/saml2/jsp/default.jsp?message=mniSuccess" />
<%
}
} else {
SAMLUtils.sendError(request, response, response.SC_BAD_REQUEST,
"requestProcessingMNIError",
SAML2Utils.bundle.getString("requestProcessingMNIError"));
return;
}
}
} catch (SAML2Exception e) {
SAML2Utils.debug.error("Error processing ManageNameIDRequest " , e);
SAMLUtils.sendError(request, response, response.SC_BAD_REQUEST,
"requestProcessingMNIError",
SAML2Utils.bundle.getString("requestProcessingMNIError") + " " +
e.getMessage());
return;
}
%>