IDPSSOFederate.java revision 6ee2adce4b7ba1c7cdee88dce16cc901d1a1e1ce
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* Portions Copyrighted 2010-2015 ForgeRock AS.
*/
/**
* from a service provider. It processes the <code>AuthnRequest</code>
* sent by the service provider and generates a proper
* <code>Response</code> that contains an <code>Assertion</code>.
* It sends back a <code>Response</code> containing error status if
* something is wrong during the request processing.
*/
public class IDPSSOFederate {
private final boolean isFromECP;
private final FederateCookieRedirector cookieRedirector;
private final SAML2ActorFactory saml2ActorFactory;
private SAML2EventLogger auditor;
this.cookieRedirector = new UtilProxyCookieRedirector();
this.saml2ActorFactory = new SAML2ActorFactory();
}
IDPSSOFederate(final boolean isFromECP,
throws ServerFaultException, ClientFaultException {
this.cookieRedirector = redirector;
this.saml2ActorFactory = saml2ActorFactory;
}
/**
* This method processes the <code>AuthnRequest</code> coming
* from a service provider via HTTP Redirect.
*
* @param request the <code>HttpServletRequest</code> object
* @param response the <code>HttpServletResponse</code> object
* @param out the print writer for writing out presentation
* @param auditor the auditor for logging SAML2 Events - may be null
*/
try {
} catch (FederatedSSOException ex) {
// Invoke the IDP Adapter after the user has been authenticated
try {
if (idpAdapter != null) {
}
} catch (SAML2Exception se2) {
}
SAMLUtils.sendError(request, response, HttpServletResponse.SC_INTERNAL_SERVER_ERROR, ex.getMessageCode(),
}
}
/**
* This method processes the <code>AuthnRequest</code> coming
* from a service provider via HTTP Redirect.
*
* @param request the <code>HttpServletRequest</code> object
* @param response the <code>HttpServletResponse</code> object
* @param out the print writer for writing out presentation
* @param isFromECP true if the request comes from ECP
* @param auditor the auditor for logging SAML2 Events - may be null
*
*/
public static void doSSOFederate(HttpServletRequest request, HttpServletResponse response, PrintWriter out,
throws FederatedSSOException {
try {
} catch (IOException ioe) {
} catch (SessionException sso) {
}
}
return this;
}
/**
* Having read the requestID, look up the preferred IDP for this request.
* If matched, send a proxy authentication request.
* Performs no action if the requestID is null.
*
* @param requestID Nullable identifier for the request. May be null.
* @throws ServerFaultException If we couldn't send the authentication request.
*/
if (preferredIDP != null) {
try {
return true;
} catch (SAML2Exception | IOException e) {
}
}
}
return false;
}
void process(final HttpServletRequest request, final HttpServletResponse response, final PrintWriter out,
return;
}
final IDPRequestValidator validator =
//IDP Proxy with introduction cookie case.
//After reading the introduction cookie, it redirects to here.
return;
}
// Fetch a number of properties about the request.
}
IDPSSOFederateRequest reqData = new IDPSSOFederateRequest(reqID, realm, idpAdapter, idpMetaAlias, idpEntityID);
// get the request id query parameter from the request. If this
// is the first visit then the request id is not set; if it is
// coming back from a successful authentication, then request
// id should be there.
SAMLAuthenticator samlAuthenticator = saml2ActorFactory.getSAMLAuthenticator(reqData, request, response,
} else {
}
}
}