Class WebSecurityConfiguration

  • All Implemented Interfaces:
    org.springframework.beans.factory.Aware, org.springframework.beans.factory.BeanClassLoaderAware, org.springframework.context.annotation.ImportAware

    @Configuration(proxyBeanMethods=false)
    public class WebSecurityConfiguration
    extends java.lang.Object
    implements org.springframework.context.annotation.ImportAware, org.springframework.beans.factory.BeanClassLoaderAware
    Uses a WebSecurity to create the FilterChainProxy that performs the web based security for Spring Security. It then exports the necessary beans. Customizations can be made to WebSecurity by extending WebSecurityConfigurerAdapter and exposing it as a Configuration or implementing WebSecurityConfigurer and exposing it as a Configuration. This configuration is imported when using EnableWebSecurity.
    Since:
    3.2
    See Also:
    EnableWebSecurity, WebSecurity
    • Constructor Detail

      • WebSecurityConfiguration

        public WebSecurityConfiguration()
    • Method Detail

      • springSecurityFilterChain

        @Bean(name="springSecurityFilterChain")
        public javax.servlet.Filter springSecurityFilterChain()
                                                       throws java.lang.Exception
        Creates the Spring Security Filter Chain
        Returns:
        the Filter that represents the security filter chain
        Throws:
        java.lang.Exception
      • setFilterChainProxySecurityConfigurer

        @Autowired(required=false)
        public void setFilterChainProxySecurityConfigurer​(ObjectPostProcessor<java.lang.Object> objectPostProcessor,
                                                          org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory)
                                                   throws java.lang.Exception
        Sets the <SecurityConfigurer<FilterChainProxy, WebSecurityBuilder> instances used to create the web configuration.
        Parameters:
        objectPostProcessor - the ObjectPostProcessor used to create a WebSecurity instance
        beanFactory - the bean factory to use to retrieve the relevant <SecurityConfigurer<FilterChainProxy, WebSecurityBuilder> instances used to create the web configuration
        Throws:
        java.lang.Exception
      • conversionServicePostProcessor

        @Bean
        public static org.springframework.beans.factory.config.BeanFactoryPostProcessor conversionServicePostProcessor()
      • setImportMetadata

        public void setImportMetadata​(org.springframework.core.type.AnnotationMetadata importMetadata)
        Specified by:
        setImportMetadata in interface org.springframework.context.annotation.ImportAware
      • setBeanClassLoader

        public void setBeanClassLoader​(java.lang.ClassLoader classLoader)
        Specified by:
        setBeanClassLoader in interface org.springframework.beans.factory.BeanClassLoaderAware