Class WebSecurityConfigurerAdapter

  • All Implemented Interfaces:
    SecurityConfigurer<javax.servlet.Filter,​WebSecurity>, WebSecurityConfigurer<WebSecurity>

    @Order(100)
    @Deprecated
    public abstract class WebSecurityConfigurerAdapter
    extends java.lang.Object
    implements WebSecurityConfigurer<WebSecurity>
    Deprecated.
    Use a SecurityFilterChain Bean to configure HttpSecurity or a WebSecurityCustomizer Bean to configure WebSecurity
    Provides a convenient base class for creating a WebSecurityConfigurer instance. The implementation allows customization by overriding methods.

    Will automatically apply the result of looking up AbstractHttpConfigurer from SpringFactoriesLoader to allow developers to extend the defaults. To do this, you must create a class that extends AbstractHttpConfigurer and then create a file in the classpath at "META-INF/spring.factories" that looks something like:

     org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer = sample.MyClassThatExtendsAbstractHttpConfigurer
     
    If you have multiple classes that should be added you can use "," to separate the values. For example:
     org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer = sample.MyClassThatExtendsAbstractHttpConfigurer, sample.OtherThatExtendsAbstractHttpConfigurer
     
    See Also:
    EnableWebSecurity
    • Constructor Detail

      • WebSecurityConfigurerAdapter

        protected WebSecurityConfigurerAdapter()
        Deprecated.
        Creates an instance with the default configuration enabled.
      • WebSecurityConfigurerAdapter

        protected WebSecurityConfigurerAdapter​(boolean disableDefaults)
        Deprecated.
        Creates an instance which allows specifying if the default configuration should be enabled. Disabling the default configuration should be considered more advanced usage as it requires more understanding of how the framework is implemented.
        Parameters:
        disableDefaults - true if the default configuration should be disabled, else false