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