/** * Creates the {@link LogoutFilter} using the {@link LogoutHandler} instances, the * {@link #logoutSuccessHandler(LogoutSuccessHandler)} and the * {@link #logoutUrl(String)}. * * @param http the builder to use * @return the {@link LogoutFilter} to use. * @throws Exception */ private LogoutFilter createLogoutFilter(H http) throws Exception { logoutHandlers.add(contextLogoutHandler); LogoutHandler[] handlers = logoutHandlers .toArray(new LogoutHandler[logoutHandlers.size()]); LogoutFilter result = new LogoutFilter(getLogoutSuccessHandler(), handlers); result.setLogoutRequestMatcher(getLogoutRequestMatcher(http)); result = postProcess(result); return result; }
/** * Creates the {@link LogoutFilter} using the {@link LogoutHandler} instances, the * {@link #logoutSuccessHandler(LogoutSuccessHandler)} and the * {@link #logoutUrl(String)}. * * @param http the builder to use * @return the {@link LogoutFilter} to use. * @throws Exception */ private LogoutFilter createLogoutFilter(H http) throws Exception { logoutHandlers.add(contextLogoutHandler); LogoutHandler[] handlers = logoutHandlers .toArray(new LogoutHandler[logoutHandlers.size()]); LogoutFilter result = new LogoutFilter(getLogoutSuccessHandler(), handlers); result.setLogoutRequestMatcher(getLogoutRequestMatcher(http)); result = postProcess(result); return result; }
@Override protected boolean requiresLogout(HttpServletRequest request, HttpServletResponse response) { String wa = request.getParameter(FederationConstants.PARAM_ACTION); if (FederationConstants.ACTION_SIGNOUT.equals(wa) || FederationConstants.ACTION_SIGNOUT_CLEANUP.equals(wa)) { // Default WS-Federation logout action return true; } if (this.logoutUrl == null) { String contextName = request.getContextPath(); if (contextName == null || contextName.isEmpty()) { contextName = "/"; } this.logoutUrl = federationConfig.getFedizContext(contextName).getLogoutURL(); } if (this.logoutUrl != null && !this.logoutUrl.isEmpty()) { super.setLogoutRequestMatcher(new AntPathRequestMatcher(logoutUrl)); return super.requiresLogout(request, response); } return false; }
@Override protected boolean requiresLogout(HttpServletRequest request, HttpServletResponse response) { String wa = request.getParameter(FederationConstants.PARAM_ACTION); if (FederationConstants.ACTION_SIGNOUT.equals(wa) || FederationConstants.ACTION_SIGNOUT_CLEANUP.equals(wa)) { // Default WS-Federation logout action return true; } if (this.logoutUrl == null) { String contextName = request.getContextPath(); if (contextName == null || contextName.isEmpty()) { contextName = "/"; } this.logoutUrl = federationConfig.getFedizContext(contextName).getLogoutURL(); } if (this.logoutUrl != null && !this.logoutUrl.isEmpty()) { super.setLogoutRequestMatcher(new AntPathRequestMatcher(logoutUrl)); return super.requiresLogout(request, response); } return false; }
/** * Creates the {@link LogoutFilter} using the {@link LogoutHandler} instances, the * {@link #logoutSuccessHandler(LogoutSuccessHandler)} and the * {@link #logoutUrl(String)}. * * @param http the builder to use * @return the {@link LogoutFilter} to use. * @throws Exception */ private LogoutFilter createLogoutFilter(H http) throws Exception { logoutHandlers.add(contextLogoutHandler); LogoutHandler[] handlers = logoutHandlers .toArray(new LogoutHandler[logoutHandlers.size()]); LogoutFilter result = new LogoutFilter(getLogoutSuccessHandler(), handlers); result.setLogoutRequestMatcher(getLogoutRequestMatcher(http)); result = postProcess(result); return result; }
@Bean public LogoutFilter requestCasGlobalLogoutFilter() { LogoutFilter logoutFilter = new LogoutFilter(env.getRequiredProperty(CAS_URL_LOGOUT) + "?service=" + env.getRequiredProperty(APP_SERVICE_HOME), new SecurityContextLogoutHandler()); // logoutFilter.setFilterProcessesUrl("/logout"); // logoutFilter.setFilterProcessesUrl("/j_spring_cas_security_logout"); logoutFilter.setLogoutRequestMatcher(new AntPathRequestMatcher("/logout", "POST")); return logoutFilter; }