/**
* 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: FSTerminationRequestServlet.java,v 1.4 2008/06/25 05:47:04 qcheng Exp $
*
*/
/**
* Initializes the servlet.
* @param config the <code>ServletConfig</code> object that contains
* configutation information for this servlet.
* @exception ServletException if an exception occurs that interrupts
* the servlet's normal operation.
*/
throws ServletException
{
}
/**
* Invoked to set some commonly used termination URLs based on hosted
* provider.
* @param hostedConfig hosted provider's extended meta
* @param metaAlias hosted provider's meta alias
*/
protected void setTerminationURL(
{
}
/**
* Handles the HTTP GET request.
* @param request <code>HttpServletRequest</code> object that contains the
* request the client has made of the servlet.
* @param response <code>HttpServletResponse</code> object that contains
* the response the servlet sends to the client.
* @exception ServletException if an input or output error is detected when
* the servlet handles the GET request
* @exception IOException if the request for the GET could not be handled
*/
public void doGet(
throws ServletException, IOException
{
}
/**
* Handles the HTTP POST request.
* @param request <code>HttpServletRequest</code> object that contains the
* request the client has made of the servlet.
* @param response <code>HttpServletResponse</code> object that contains
* the response the servlet sends to the client.
* @exception ServletException if an input or output error is detected when
* the servlet handles the POST request
* @exception IOException if the request for the POST could not be handled
*/
public void doPost(
throws ServletException, IOException
{
}
/**
* Handles termination request.
* @param request <code>HttpServletRequest</code> object that contains the
* request the client has made of the servlet.
* @param response <code>HttpServletResponse</code> object that contains
* the response the servlet sends to the client.
* @exception IOException if the request could not be handled
*/
private void doGetPost(
throws ServletException, IOException
{
// Alias processing
+ "Provider. Cannot process request");
}
return;
}
if (metaManager == null) {
"Cannot retrieve hosted descriptor. Cannot process request");
return;
}
try {
if (hostedProviderRole != null &&
{
} else if (hostedProviderRole != null &&
{
}
if (hostedProviderDesc == null) {
}
}catch (IDFFMetaException eam) {
"Unable to find Hosted Provider. not process request");
return;
}
try {
} catch (FSMsgException e) {
return;
} catch (SAMLException e) {
return;
}
if (fedTermObj == null) {
} else {
}
return;
}
/**
* Called when a Termination request is received from a remote provider.
* @param request <code>HTTPServletRequest</code> object received via HTTP
* Redirect
* @param response <code>HTTPServletResponse</code> object to send the
* response back to user agent
* @param hostedProviderDesc the provider for whom request is received
* @param hostedConfig hosted provider's extended meta
* @param hostedProviderRole hosted provider's role
* @param realm The realm under which the entity resides
* @param hostedEntityId hosted provider's entity ID
* @param providerAlias hosted provider's meta alias
* @param reqTermination the federation termination request
*/
private void doRequestProcessing (
{
"Entered FSTerminationRequestServlet::doRequestProcessing");
boolean isIDP = false;
try {
isIDP = true;
} else {
}
if (remoteDesc == null) {
}
} catch (IDFFMetaException e) {
"Processing: Can not retrieve remote provider data."
+ remoteEntityId);
return;
}
boolean bVerify = true;
if (FSServiceUtils.isSigningOn()) {
try {
if (remoteDesc != null) {
} else{
return;
}
} catch(FSException e) {
"FSTerminationRequestServlet::doRequestProcessing " +
"Signature on termination request is invalid" +
"Cannot proceed federation termination");
return;
} catch(SAMLException e) {
"FSFedTerminationHandler::doRequestProcessing " +
"Signature on termination request is invalid" +
"Cannot proceed federation termination");
return;
}
}
if (bVerify) {
// Check if trusted provider
{
if (instService != null){
if (termHandler != null) {
return;
} else {
"handler. User account Not valid");
}
} else {
+ " Cannot process termination request");
}
} else {
}
} else {
"FSTerminationRequestServlet::doRequestProcesing " +
"Signature on termination request is invalid" +
"Cannot proceed federation termination");
}
}
/**
* Verifies signature on Termination request received from the remote end.
* @param request <code>HttpServletRequest</code> containing the signed
* termination request
* @param remoteDescriptor provider who sent the termination request
* @param remoteEntityId remote provider's entity ID
* @param isIDP whether the remote provider is an IDP or not
* @return <code>true</code> if signatre is valid; <code>false</code>
* otherwise.
* @exception SAMLException, FSException if an error occurred during the
* process
*/
private boolean verifyTerminationSignature(
boolean isIDP)
throws SAMLException, FSException
{
"Entered FSTerminationRequestServlet::verifyTerminationSignature");
// Verify the signature on the request
"FSFedTerminationRequestServlet.verifyTerminationSignature:"
+ "couldn't obtain this site's cert .");
}
throw new SAMLResponderException(
}
boolean isValidSign =
if (!isValidSign) {
"Termination request is not properly signed");
return false;
} else {
return true;
}
}
} // FSTerminationRequestServlet