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