@Override
protected void configure(HttpSecurity http) throws Exception {
http.csrf().and().headers().and().anonymous().disable()
.formLogin().loginPage("/login.html").failureHandler(this.authenticationFailureHandler)
.defaultSuccessUrl("/main").loginProcessingUrl("/j_spring_security_check")
.usernameParameter("j_username").passwordParameter("j_password")
.and()
.logout().logoutUrl("/j_spring_security_logout").logoutSuccessUrl("/login.html");
}
当我点击登录按钮时,它会将我重定向到
1条答案
按热度按时间7bsow1i61#
将其添加到安全配置类中。authorizerequests().antmatchers(“/login*”).permitall()
删除以下和().headers()和().anonymous()