/**
* 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]"
*
* $Id: FSIntersiteTransferService.java,v 1.6 2008/08/29 04:57:16 exu Exp $
*
*/
/**
* Gets called to send <code>AuthnRequest</code> to <code>IDP</code>.
*/
private void redirectToCommonDomain(
{
+ "redirectToCommonDomain: Called");
}
try {
cotSet);
}
+ "ToCommonDomain: No CommonDomain metadata found");
data);
//response.sendRedirect(framedLoginPageURL);
return;
}
}
+ "redirectToCommonDomain: No more CommonDomain left");
data);
//response.sendRedirect(framedLoginPageURL);
return;
}
if(readerServiceURL != null){
.append("=")
.append("=")
+ "redirectToCommonDomain: "
+ "Redirecting to check for PrefferedIDP @:" + url);
}
return;
}
} catch(COTException e){
+ "redirectToCommonDomain: "
+ "COTException occured while trying to "
+ "redirect to the CommonDomain: " , e);
try {
//response.sendRedirect(framedLoginPageURL);
+ "redirectToCommonDomain: IOException : " , ex);
}
return;
} catch(IOException e){
+ "redirectToCommonDomain: IOException"
+ " occured while trying to redirect to the CommonDomain: ", e);
return;
}
}
"FSIntersiteTransferService.findRequestID: Called");
"FSIntersiteTransferService.findRequestID:"
+ "No requestID in the query string");
}
return null;
} else {
return requestID;
}
}
)
{
+ "signAndReturnQueryString: Called");
}
+ "signAndReturnQueryString: "
return null;
} else {
+ "signAndReturnQueryString: certAlias: " + certAlias);
}
}
+ "signAndReturnQueryString: "
return null;
}
{
"FSIntersiteTransferService.signAndReturnQueryString: "
+ "private key algorithm is: RSA");
}
{
"FSIntersiteTransferService.signAndReturnQueryString: "
+ "private key algorithm is: DSA");
}
} else {
"FSIntersiteTransferService.signAndReturnQueryString: "
+ "private key algorithm is not supported");
return null;
}
}
}
} else {
"FSIntersiteTransferService.signAndReturnQueryString: "
+ "Invalid signature algorithim");
return null;
}
"FSIntersiteTransferService.signAndReturnQueryString: "
+ "Querystring to be signed: " + queryString);
}
try {
} catch(FSSignatureException se){
+ "signAndReturnQueryString: FSSignatureException occured "
+ "while signing query string: "
+ se.getMessage());
return null;
}
+ "signAndReturnQueryString: Signature generated is null");
return null;
}
+ "signAndReturnQueryString:Signed Querystring: "
+ queryString);
}
return queryString;
}
/**
* Generates <code>AuthnRequest</code> and sends it to <code>IDP</code>.
* @param request <code>HttpServletRequest</code> object
* @param response <code>HttpServletResponse</code> object
* @exception ServletException,IOException if error occurred
*/
public void doGet(
) throws ServletException, IOException
{
/**
* Check to see if there is a need to set lb cookie.
* This is for the use case that AuthnRequest is not created by the
* preLogin process and lb cookie wasn't set there.
*/
return;
}
try {
}
return;
}
+ "QueryString Received from CommonDomain: " + qs);
}
//throw error page
return;
}
+ "RequestID found: " + requestID);
}
if (authnRequest == null) {
return;
}
+ "No Preffered IDP found in this Common Domain. "
+ "Try to find PrefferedIDP in other common domains");
}
+ "RequestID :" + requestID);
}
return;
} else {
if (idpDescriptor == null) {
return;
}
}
+ "Preffered IDP found:" + idpID);
}
// Set the authn request version here
{
}
}
{
}
}
}
}
{
return;
return;
}
+ "Unknown Protocol Profile");
return;
} catch(Exception e){
try {
return;
} catch(IOException ioe){
}
}
}
}
/**
* Generates <code>AuthnRequest</code> and sends it to <code>IDP</code>.
* @param request <code>HttpServletRequest</code> object
* @param response <code>HttpServletResponse</code> object
* @exception ServletException,IOException if error occurred
*/
public void doPost(
{
}
private void handleBrowserArtifactPOSTIST(
)
{
"FSIntersiteTransferService.handleBrowserArtifactPOSTIST: Called");
try {
(authnRequest == null) ||
(idpDescriptor == null))
{
return;
}
return;
}
+ "handleBrowserArtifactPOSTIST: "
+ "Destination URL to send AuthnRequest: "
+ targetURL);
}
// Call SP adapter in case of browser GET
"GET, call spAdapter.preSSOFederationRequest");
}
try {
} catch (Exception e) {
// log run time exception in Adapter
// implementation, continue
+ "GET SPAdapter.preSSOFederationRequest:", e);
}
}
if (queryString == null) {
+ "handleBrowserArtifactPOSTIST: "
return;
}
//signAuthnRequest If specified
if (FSServiceUtils.isSigningOn()) {
if (authnRequestSigned) {
if (queryString == null){
+ "handleBrowserArtifactPOSTIST: "
+ "AuthnRequest signing failed");
return;
}
}
}
} else {
}
{ targetURL };
+ "handleBrowserArtifactPOSTIST: Redirection URL"
+ " length exceeding the URL MAX length restriction. "
+ "Switching to form post");
}
if (authnRequestSigned) {
}
return;
}
+ "handleBrowserArtifactPOSTIST: "
+ "Sending AuthnRequest by http-redirect to: "
+ targetURL);
}
+ "handleBrowserArtifactPOSTIST:" , ex);
try {
} catch(IOException ioe){
+ "handleBrowserArtifactPOSTIST: "
}
return;
}
}
private void handleWMLIST(
)
{
try {
"FSIntersiteTransferService.handleWMLIST: Called");
(authnRequest == null) ||
(idpDescriptor == null))
{
return;
}
return;
}
"FSIntersiteTransferService.handleWMLIST: "
+ "Destination URL to send AuthnRequest: " + targetURL);
}
return;
try {
} catch(IOException ioe){
}
return;
}
}
private boolean sendWMLB64Post(
)
{
"FSIntersiteTransferService:sendWMLB64Post: Called");
try {
+ " \"http://www.wapforum.org/DTD/wml_1.1.xml\">");
+ "\" " + "value=\""
"FSIntersiteTransferService:sendWMLB64Post: "
+ "Base64 Encoded AuthnRequest at the Sender: "
}
"FSIntersiteTransferService:sendWMLB64Post: "
+ "AuthnRequest sent successfully to: " + destination);
}
return true;
ex);
return false;
}
}
protected void sendAuthnRequestPost(
)
{
"FSIntersiteTransferService.sendAuthnRequestPost: Called");
try {
+ destination + "\">");
+ "\" " + "VALUE=\""
"FSIntersiteTransferService:sendAuthnRequestPost: "
+ "Base64 Encoded AuthnRequest at the Sender: "
+ "\nFSIntersiteTransferService:sendAuthnRequestPost: "
+ "AuthnRequest sent successfully to: "
+ destination);
}
return;
"FSIntersiteTransferService:sendAuthnRequestPost:", ex);
return;
}
}
}