1 package com.liferay.portal.servlet.filters.sso;
3 import java.io.IOException;
5 import javax.servlet.FilterChain;
6 import javax.servlet.ServletException;
7 import javax.servlet.http.HttpServletRequest;
8 import javax.servlet.http.HttpServletResponse;
9 import javax.servlet.http.HttpSession;
11 import com.liferay.portal.kernel.log.Log;
12 import com.liferay.portal.kernel.log.LogFactoryUtil;
13 import com.liferay.portal.kernel.servlet.BaseFilter;
14 import com.liferay.portal.util.PortalUtil;
15 import com.pentila.entSavoie.utils.ENTMainUtilsLocalServiceUtil;
17 public class ShibbolethFilter extends BaseFilter {
20 protected Log getLog() {
25 protected void processFilter(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) throws IOException,
28 long companyId = PortalUtil.getCompanyId(request);
30 if (ENTMainUtilsLocalServiceUtil.isShibbolethAuthEnable(companyId)) {
31 String pathInfo = request.getPathInfo();
33 if (pathInfo.indexOf("/portal/logout") != -1) {
34 HttpSession session = request.getSession();
36 String logoutUrl = ENTMainUtilsLocalServiceUtil.getShibbolethLogoutUrl(companyId);
37 response.sendRedirect(logoutUrl);
40 // on fait rien, on est pas sur le logout....
44 processFilter(ShibbolethFilter.class, request, response, filterChain);
53 private static Log _log = LogFactoryUtil.getLog(ShibbolethFilter.class);