/**
* 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: FSRegistrationReturnServlet.java,v 1.4 2008/06/25 05:47:03 qcheng Exp $
*
*/
/**
* Handles registration return.
*/
/**
* 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
{
}
/**
* 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
*/
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
*/
throws ServletException, IOException
{
}
/**
* Handles the 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 request
* @exception IOException if the request could not be handled
*/
throws ServletException, IOException
{
" Provider. Cannot process request");
return;
}
if (metaManager == null) {
"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;
}
// Here we will need to
// 1. verify response signature
// 2. verify response status
// 3. retrieve registration request Id from Map
// 4. if status success then do locally else not do locally and
// 5. show status page or LRURL if found in MAP
// (eg intersiteTransfer)
try {
} catch (FSMsgException e) {
return;
} catch (SAMLException e) {
return;
}
boolean isIDP = false;
try {
isIDP = true;
} else {
}
} catch (IDFFMetaException e){
}
if (remoteDesc == null) {
return;
}
boolean bVerify = true;
try {
if (FSServiceUtils.isSigningOn()) {
}
} catch (SAMLException e){
bVerify = false;
} catch (FSException e){
bVerify = false;
}
if (bVerify) {
new FSNameRegistrationHandler();
return;
} else {
"FSRegistrationReturnServlet " +
"Signature on registration request is invalid" +
"Cannot proceed name registration");
return;
}
}
/**
* Verifies the Registration request signature received from the remote end.
* @param request <code>HttpServletRequest</code> containing the signed
* registration request
* @param remoteDescriptor remote provider who signed the request
* @param remoteEntityId remote provider's entity ID
* @param isIDP whether the remote provider is an IDP or not
* @return <code>true</code> if the signature is valid; <code>false</code>
* otherwise.
* @exception SAMLException, FSException if an error occurred during the
* process
*/
private boolean verifyResponseSignature(
boolean isIDP)
throws SAMLException, FSException
{
"Entered FSRegistrationRequestServlet::verifyRegistrationSignature");
// Verify the signature on the request
"FSRegistrationRequestServlet.verifyRegistrationSignature: "
+ "couldn't obtain this site's cert.");
}
throw new SAMLResponderException(
}
boolean isValidSign =
if (!isValidSign) {
"Registration response is not properly signed");
return false;
} else {
return true;
}
}
/**
* Invoked to set some commonly used registration URLs based on hosted
* provider.
* @param hostedConfig hosted provider's extended meta
* @param metaAlias hosted provider's meta alias
*/
protected void setRegistrationURL(
{
}
}
} // FSRegistrationReturnServlet