use of org.springframework.security.web.authentication.logout.LogoutFilter in project spring-security by spring-projects.
the class LogoutConfigurer method createLogoutFilter.
/**
* 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.
*/
private LogoutFilter createLogoutFilter(H http) {
this.logoutHandlers.add(this.contextLogoutHandler);
this.logoutHandlers.add(postProcess(new LogoutSuccessEventPublishingLogoutHandler()));
LogoutHandler[] handlers = this.logoutHandlers.toArray(new LogoutHandler[0]);
LogoutFilter result = new LogoutFilter(getLogoutSuccessHandler(), handlers);
result.setLogoutRequestMatcher(getLogoutRequestMatcher(http));
result = postProcess(result);
return result;
}
use of org.springframework.security.web.authentication.logout.LogoutFilter in project spring-security by spring-projects.
the class ServletApiConfigurerTests method checkSecurityContextAwareAndLogoutFilterHasSameSizeAndHasLogoutSuccessEventPublishingLogoutHandler.
@Test
public void checkSecurityContextAwareAndLogoutFilterHasSameSizeAndHasLogoutSuccessEventPublishingLogoutHandler() {
this.spring.register(ServletApiWithLogoutConfig.class);
SecurityContextHolderAwareRequestFilter scaFilter = getFilter(SecurityContextHolderAwareRequestFilter.class);
LogoutFilter logoutFilter = getFilter(LogoutFilter.class);
LogoutHandler lfLogoutHandler = getFieldValue(logoutFilter, "handler");
assertThat(lfLogoutHandler).isInstanceOf(CompositeLogoutHandler.class);
List<LogoutHandler> scaLogoutHandlers = getFieldValue(scaFilter, "logoutHandlers");
List<LogoutHandler> lfLogoutHandlers = getFieldValue(lfLogoutHandler, "logoutHandlers");
assertThat(scaLogoutHandlers).hasSameSizeAs(lfLogoutHandlers);
assertThat(scaLogoutHandlers).hasAtLeastOneElementOfType(LogoutSuccessEventPublishingLogoutHandler.class);
assertThat(lfLogoutHandlers).hasAtLeastOneElementOfType(LogoutSuccessEventPublishingLogoutHandler.class);
}
use of org.springframework.security.web.authentication.logout.LogoutFilter in project wombat by PLOS.
the class SpringSecurityConfiguration method requestLogoutFilter.
private LogoutFilter requestLogoutFilter() {
// This filter redirects to the CAS Server to signal Single Logout should be performed
SecurityContextLogoutHandler logoutHandler = new SecurityContextLogoutHandler();
logoutHandler.setClearAuthentication(true);
logoutHandler.setInvalidateHttpSession(true);
LogoutFilter logoutFilter = new LogoutFilter(getLogoutSuccessHandler(), logoutHandler);
logoutFilter.setFilterProcessesUrl(CAS_LOGOUT_URI);
return logoutFilter;
}
use of org.springframework.security.web.authentication.logout.LogoutFilter in project motech by motech.
the class SecurityRuleBuilder method addLogoutFilter.
private void addLogoutFilter(List<Filter> filters, MotechURLSecurityRule securityRule) {
if (securityRule.isRest()) {
return;
}
LogoutHandler springLogoutHandler = new SecurityContextLogoutHandler();
LogoutFilter logoutFilter = new LogoutFilter("/module/server/login", motechLogoutHandler, springLogoutHandler);
logoutFilter.setFilterProcessesUrl("/module/server/j_spring_security_logout");
filters.add(logoutFilter);
}
use of org.springframework.security.web.authentication.logout.LogoutFilter in project esup-papercut by EsupPortail.
the class CasConfig method logoutFilter.
@Bean
public LogoutFilter logoutFilter() {
LogoutFilter logoutFilter = new LogoutFilter(url + "/logout?service=" + service, securityContextLogoutHandler());
logoutFilter.setFilterProcessesUrl("/logout");
return logoutFilter;
}
Aggregations