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