idpSSOFederate.jsp revision e8721886dbfd32e88cc7077cbee4b6bb1b44b443
98N/A<%--
98N/A DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
378N/A
98N/A Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
98N/A
98N/A The contents of this file are subject to the terms
98N/A of the Common Development and Distribution License
98N/A (the License). You may not use this file except in
98N/A compliance with the License.
98N/A
98N/A You can obtain a copy of the License at
98N/A https://opensso.dev.java.net/public/CDDLv1.0.html or
98N/A opensso/legal/CDDLv1.0.txt
98N/A See the License for the specific language governing
98N/A permission and limitations under the License.
98N/A
98N/A When distributing Covered Code, include this CDDL
98N/A Header Notice in each file and include the License file
98N/A at opensso/legal/CDDLv1.0.txt.
98N/A If applicable, add the following below the CDDL Header,
98N/A with the fields enclosed by brackets [] replaced by
98N/A your own identifying information:
98N/A "Portions Copyrighted [year] [name of copyright owner]"
98N/A
98N/A $Id: idpSSOFederate.jsp,v 1.6 2009/10/15 00:00:41 exu Exp $
98N/A
98N/A--%>
98N/A
98N/A
98N/A
527N/A
98N/A
98N/A<!-- %@ page import="com.iplanet.am.util.Debug" % -->
493N/A<%@ page import="com.sun.identity.shared.debug.Debug" %>
493N/A
98N/A<%@ page import="com.sun.identity.saml2.common.SAML2Constants" %>
98N/A<%@ page import="com.sun.identity.saml2.common.SAML2Exception" %>
527N/A<%@ page import="com.sun.identity.saml2.common.SAML2Utils" %>
98N/A<%@ page import="com.sun.identity.saml.common.SAMLUtils" %>
98N/A<%@ page import="com.sun.identity.saml2.profile.IDPSSOUtil" %>
493N/A<%@ page import="com.sun.identity.saml2.profile.IDPSSOFederate" %>
493N/A<%
98N/A // check request, response
98N/A if ((request == null) || (response == null)) {
156N/A SAMLUtils.sendError(request, response, response.SC_BAD_REQUEST,
156N/A "nullInput", SAML2Utils.bundle.getString("nullInput"));
493N/A return;
493N/A }
493N/A
493N/A try {
493N/A String cachedResID = request.getParameter(SAML2Constants.RES_INFO_ID);
493N/A // if this id is set, then this is a redirect from the COT
493N/A // cookie writer. There is already an assertion response
98N/A // cached in this provider. Send it back directly.
98N/A if ((cachedResID != null) && (cachedResID.length() != 0)) {
98N/A IDPSSOUtil.sendResponse(request, response, cachedResID);
98N/A return;
98N/A }
98N/A } catch (SAML2Exception sse) {
527N/A SAML2Utils.debug.error("Error processing request " , sse);
527N/A SAMLUtils.sendError(request, response, response.SC_BAD_REQUEST,
183N/A "requestProcessingError",
527N/A SAML2Utils.bundle.getString("requestProcessingError") + " " +
98N/A sse.getMessage());
493N/A return;
493N/A }
493N/A
98N/A String reqBinding = SAML2Constants.HTTP_REDIRECT;
493N/A if (request.getMethod().equals("POST")) {
493N/A reqBinding = SAML2Constants.HTTP_POST;
493N/A }
98N/A
156N/A /*
156N/A * This call handles the federation and/or single sign on request
98N/A * from a service provider. It processes the AuthnRequest
98N/A * sent by the service provider and generates a proper
493N/A * SAML Response that contains an Assertion.
493N/A * It sends back a response containing error status if
156N/A * something is wrong during the request processing.
156N/A */
98N/A IDPSSOFederate.doSSOFederate(request, response, reqBinding );
98N/A%>
493N/A