October 2018
Intermediate to advanced
590 pages
15h 5m
English
Now, let's update SecurityConfiguration to make Spring Security aware of the new filter and handlers:
...public class SecurityConfiguration extends WebSecurityConfigurerAdapter { ... @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeRequests() .antMatchers(PUBLIC).permitAll() .anyRequest().authenticated() .and() .addFilterAt(authenticationFilter(), UsernamePasswordAuthenticationFilter.class) .formLogin().loginPage("/login") .and() .logout().logoutUrl("/logout") .logoutSuccessHandler(logoutSuccessHandler()) .and() .csrf().disable(); } ... @Bean public AuthenticationFilter authenticationFilter() throws Exception { AuthenticationFilter authenticationFilter = new AuthenticationFilter(); ...Read now
Unlock full access