From do-not-reply at jboss.org Fri Apr 16 02:51:03 2010 Content-Type: multipart/mixed; boundary="===============0371708421016530785==" MIME-Version: 1.0 From: do-not-reply at jboss.org To: gatein-commits at lists.jboss.org Subject: [gatein-commits] gatein SVN: r2671 - components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter. Date: Fri, 16 Apr 2010 02:51:03 -0400 Message-ID: <201004160651.o3G6p3kg022112@svn01.web.mwc.hst.phx2.redhat.com> --===============0371708421016530785== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: sohil.shah(a)jboss.com Date: 2010-04-16 02:51:03 -0400 (Fri, 16 Apr 2010) New Revision: 2671 Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter/CAS= LogoutFilter.java Log: GTNPORTAL-996 - GateIn+JOSSO integration: Problems with logout Added: components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter= /CASLogoutFilter.java =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter/CA= SLogoutFilter.java (rev 0) +++ components/sso/trunk/agent/src/main/java/org/gatein/sso/agent/filter/CA= SLogoutFilter.java 2010-04-16 06:51:03 UTC (rev 2671) @@ -0,0 +1,75 @@ +/* +* JBoss, a division of Red Hat +* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as = indicated +* by the @authors tag. See the copyright.txt in the distribution for a +* full listing of individual contributors. +* +* This is free software; you can redistribute it and/or modify it +* under the terms of the GNU Lesser General Public License as +* published by the Free Software Foundation; either version 2.1 of +* the License, or (at your option) any later version. +* +* This software is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this software; if not, write to the Free +* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +* 02110-1301 USA, or see the FSF site: http://www.fsf.org. +*/ +package org.gatein.sso.agent.filter; + +import java.net.URLEncoder; +import javax.servlet.http.HttpServletRequest; + +//Works for GateIn Portal Logout URL =3D {AnyURL}?portal:componentId=3DUIP= ortal&portal:action=3DLogout + +/** + * Usage: + * = + * Add the following to portal.war/WEB-INF/web.xml + * = + * + * CASLogoutFilter = = + * org.gatein.sso.agent.filter.CASLogoutFilter = + * = + * = = = + * LOGOUT_URL = = + * http://localhost:8888/cas/logout = = = + * = = + * = + * = + * + * CASLogoutFilter + * /* + * + * + * = + * = + */ + + +/** + * @author Sohil Shah + */ +public class CASLogoutFilter extends AbstractLogoutFilter +{ = + protected String getRedirectUrl(HttpServletRequest httpRequest) + { + try + { + String parameters =3D URLEncoder.encode( + "portal:componentId=3DUIPortal&portal:action=3DLogout", "UTF-8"); + = + String redirectUrl =3D this.logoutUrl+"?url=3D"+httpRequest.getRequestU= RL()+"?"+parameters; + = + return redirectUrl; + } + catch(Exception e) + { + throw new RuntimeException(e); + } + } +} --===============0371708421016530785==--