/**
* 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: FSRegistrationRequestServlet.java,v 1.4 2008/06/25 05:47:03 qcheng Exp $
*
*/
/**
* Handles registration request received from remote provider.
*/
/**
* 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 registration URLs based on hosted
* provider.
* @param hostedConfig hosted provider's extended meta
* @param metaAlias hosted provider's meta alias
*/
protected void setRegistrationURL(
{
}
}
/**
* 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 registration request.
* in the application
* @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 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;
}
new FSNameRegistrationRequest();
try {
} catch (FSMsgException e) {
return;
} catch (SAMLException e) {
return;
}
if (regisRequest == null) {
} else {
}
}
/**
* Called when a registration request is received from
* a remote provider. Initiates registration request processing.
* @param request <code>HTTPServletRequest</code> object received via a
* 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 provider resides
* @param hostedEntityId hosted provider's entity ID
* @param providerAlias hosted provider's meta alias
* @param regisRequest the federation registration request
*/
private void doRequestProcessing(
{
"Entered FSRegistrationRequestServlet::doRequestProcessing");
boolean isIDP = false;
try {
isIDP = true;
} else {
}
} catch (IDFFMetaException e) {
"Processing: Can not retrieve remote provider data."
+ remoteEntityId);
return;
}
boolean bVerify = true;
if (FSServiceUtils.isSigningOn()) {
try {
if (remoteDesc != null){
"Calling verifyRegistrationSignature");
} else{
return;
}
} catch(FSException e) {
"FSRegistrationRequestServlet::processRegistrationRequest "+
"Signature on registration request is invalid" +
"Cannot proceed federation registration");
return;
} catch(SAMLException e) {
"FSRegistrationRequestServlet::processRegistrationRequest" +
"Signature on registration request is invalid" +
"Cannot proceed federation registration");
return;
}
}
if (bVerify) {
// Check if trusted provider
{
new FSNameRegistrationHandler();
if (regisHandler != null) {
return;
} else {
"handler. User account Not valid");
}
} else {
}
} else {
"FSRegistrationRequestServlet::doRequestProcesing " +
"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 verified;
* <code>false</code>
* otherwise
* @exception SAMLException, FSException if an error occurred during
* the process
*/
private boolean verifyRegistrationSignature(
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 request is not properly signed");
return false;
} else {
return true;
}
}
} // FSRegistrationRequestServlet