a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * The contents of this file are subject to the terms
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * of the Common Development and Distribution License
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * (the License). You may not use this file except in
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * compliance with the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * You can obtain a copy of the License at
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * https://opensso.dev.java.net/public/CDDLv1.0.html or
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * See the License for the specific language governing
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * permission and limitations under the License.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * When distributing Covered Code, include this CDDL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Header Notice in each file and include the License file
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * If applicable, add the following below the CDDL Header,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * with the fields enclosed by brackets [] replaced by
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * your own identifying information:
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * "Portions Copyrighted [year] [name of copyright owner]"
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * $Id: FSConsentHandler.java,v 1.2 2008/06/25 05:46:42 qcheng Exp $
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterimport com.sun.identity.federation.common.FSUtils;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterimport com.sun.identity.federation.common.IFSConstants;
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * This servlet redirects the request to the introduction
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * URL or the provider home page URL based on the
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * action in the request.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Fosterpublic class FSConsentHandler extends HttpServlet {
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Processes requests for both HTTP <code>GET</code> and
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * <code>POST</code> methods. Redirects to provider URL
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * if the action is cancel or to the introduction URL.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param request the <code>HttpServletRequest</code> object.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param response the <code>HttpServletResponse</code> object.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception ServletException if the request could not be
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception IOException if an input or output error occurs.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster protected void processRequest(HttpServletRequest request,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster String action = request.getParameter(IFSConstants.USERACTION);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster action.trim().equalsIgnoreCase(IFSConstants.CANCEL))
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "FSConsentHandler:: user pressed cancel proceding to lrurl");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster lrurl = request.getParameter(IFSConstants.LRURL);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "FSConsentHandler:: selected provider is "
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster FSUtils.debug.error("FSConsentHandler::FSPostLogin Exception",
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster FSUtils.debug.message("FSConsentHandler:: Redirecting to "
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster FSUtils.forwardRequest(request, response, lrurl);
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster "FSConsentHandler:: LRURL is null in request ");
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Handles the HTTP <code>GET</code> method.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param request the <code>HttpServletRequest</code> object.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param response the <code>HttpServletResponse</code> object.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception ServletException if the request could not be
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception IOException if an input or output error occurs.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster protected void doGet(HttpServletRequest request,
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * Handles the HTTP <code>POST</code> method.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param request the <code>HttpServletRequest</code> object.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @param response the <code>HttpServletResponse</code> object.
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception ServletException if the request could not be
a688bcbb4bcff5398fdd29b86f83450257dc0df4Allan Foster * @exception IOException if an input or output error occurs.