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