SpringSecurity主要配置类为WebSecurityConfig类。其中,主要用其实现类进行配置,代码如下:

    1. @Configuration
    2. public class SecurityConfig extends WebSecurityConfigurerAdapter {
    3. @Override
    4. protected void configure(HttpSecurity http) throws Exception {
    5. }
    6. @Override
    7. protected void configure(AuthenticationManagerBuilder auth) throws Exception {
    8. }
    9. }