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