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