Search in sources :

Example 1 with DelegatingFilterProxy

use of org.springframework.web.filter.DelegatingFilterProxy in project spring-security by spring-projects.

the class AbstractSecurityWebApplicationInitializer method insertSpringSecurityFilterChain.

/**
	 * Registers the springSecurityFilterChain
	 * @param servletContext the {@link ServletContext}
	 */
private void insertSpringSecurityFilterChain(ServletContext servletContext) {
    String filterName = DEFAULT_FILTER_NAME;
    DelegatingFilterProxy springSecurityFilterChain = new DelegatingFilterProxy(filterName);
    String contextAttribute = getWebApplicationContextAttribute();
    if (contextAttribute != null) {
        springSecurityFilterChain.setContextAttribute(contextAttribute);
    }
    registerFilter(servletContext, true, filterName, springSecurityFilterChain);
}
Also used : DelegatingFilterProxy(org.springframework.web.filter.DelegatingFilterProxy)

Example 2 with DelegatingFilterProxy

use of org.springframework.web.filter.DelegatingFilterProxy in project gocd by gocd.

the class ApiSessionFilterIntegrationTest method setUp.

@Before
public void setUp() throws Exception {
    WebApplicationContext wac = mock(WebApplicationContext.class);
    when(wac.getBean("filterChainProxy", javax.servlet.Filter.class)).thenReturn(filterChainProxy);
    when(wac.getBean("backupService")).thenReturn(mock(BackupService.class));
    filterChainProxy.init(new MockFilterConfig());
    servletContext = new MockServletContext();
    servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, wac);
    proxy = new DelegatingFilterProxy("filterChainProxy", wac);
    proxy.setServletContext(servletContext);
}
Also used : BackupService(com.thoughtworks.go.server.service.BackupService) WebApplicationContext(org.springframework.web.context.WebApplicationContext) DelegatingFilterProxy(org.springframework.web.filter.DelegatingFilterProxy) Before(org.junit.Before)

Example 3 with DelegatingFilterProxy

use of org.springframework.web.filter.DelegatingFilterProxy in project Activiti by Activiti.

the class WebConfigurer method initSpringSecurity.

/**
   * Initializes Spring Security.
   */
private void initSpringSecurity(ServletContext servletContext, EnumSet<DispatcherType> disps) {
    log.debug("Registering Spring Security Filter");
    FilterRegistration.Dynamic springSecurityFilter = servletContext.addFilter("springSecurityFilterChain", new DelegatingFilterProxy());
    springSecurityFilter.addMappingForUrlPatterns(disps, false, "/*");
    springSecurityFilter.setAsyncSupported(true);
}
Also used : DelegatingFilterProxy(org.springframework.web.filter.DelegatingFilterProxy) FilterRegistration(javax.servlet.FilterRegistration)

Example 4 with DelegatingFilterProxy

use of org.springframework.web.filter.DelegatingFilterProxy in project Activiti by Activiti.

the class JPAWebConfigurer method initSpringSecurity.

/**
   * Initializes Spring Security.
   */
private void initSpringSecurity(ServletContext servletContext, EnumSet<DispatcherType> disps) {
    log.debug("Registering Spring Security Filter");
    FilterRegistration.Dynamic springSecurityFilter = servletContext.addFilter("springSecurityFilterChain", new DelegatingFilterProxy());
    springSecurityFilter.addMappingForUrlPatterns(disps, false, "/*");
}
Also used : DelegatingFilterProxy(org.springframework.web.filter.DelegatingFilterProxy) FilterRegistration(javax.servlet.FilterRegistration)

Example 5 with DelegatingFilterProxy

use of org.springframework.web.filter.DelegatingFilterProxy in project Activiti by Activiti.

the class WebConfigurer method initSpringSecurity.

/**
   * Initializes Spring Security.
   */
private void initSpringSecurity(ServletContext servletContext, EnumSet<DispatcherType> disps) {
    log.debug("Registering Spring Security Filter");
    FilterRegistration.Dynamic springSecurityFilter = servletContext.addFilter("springSecurityFilterChain", new DelegatingFilterProxy());
    springSecurityFilter.addMappingForUrlPatterns(disps, false, "/*");
}
Also used : DelegatingFilterProxy(org.springframework.web.filter.DelegatingFilterProxy) FilterRegistration(javax.servlet.FilterRegistration)

Aggregations

DelegatingFilterProxy (org.springframework.web.filter.DelegatingFilterProxy)7 FilterRegistration (javax.servlet.FilterRegistration)3 BackupService (com.thoughtworks.go.server.service.BackupService)1 Before (org.junit.Before)1 WebApplicationContext (org.springframework.web.context.WebApplicationContext)1