Olá estou com um erro no login: O primeiro login funciona, aí do logout e tento logar de novo e ocorre que meu sistema tentar me enviar para um url que não existe no meu projeto que é a /error.
Porém no console do eclipse não aparece erro algum e o login foi realizado com sucesso.
erro:
Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Jun 26 13:47:30 BRT 2019 There was an unexpected error (type=Not Found, status=404). Not Found
Minha configuração de login:
@Configuration @EnableWebSecurity public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Autowired
private AuthenticationCustomerProvider authentication;
@Bean
public LogoutSuccessHandler logoutSuccessHandler() {
return new LogoutCustomHandler();
}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().disable()
.authorizeRequests()
.antMatchers("/js/**","/assets/**").permitAll()
.anyRequest().authenticated()
.and()
.formLogin().loginPage("/agent-web").defaultSuccessUrl("/loginSuccess").permitAll()
.and()
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logoff")).permitAll()
.logoutSuccessHandler(logoutSuccessHandler())
.logoutSuccessUrl("/agent-web");
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.authenticationProvider(this.authentication);
}
}