@Override
protected void configure(HttpSecurity http) throws Exception {
http
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login").permitAll()
.usernameParameter(USERNAME_PARAMETER)
.passwordParameter(PASSWORD_PARAMETER)
.successHandler(authenticationSuccessHandler()) (1)
.failureHandler(authenticationFailureHandler()) (2)
}
@Bean
AuthenticationSuccessHandler authenticationSuccessHandler() {
return new HoneymonUserAuthenticationSuccessHandler();
}
@Bean
AuthenticationFailureHandler authenticationFailureHandler() {
return new HoneymonUserAuthenticationFailureHandler();
}