0
我使用spring-boot和spring-security构建项目,使用自定义登录页面404次错误,我想要做的是分离登录页面和项目,并验证在登录页面上使用Ajax URL发送的用户信息,但总是出错403,我更改了spring boot security configue的配置信息,但没有具体的效果。下面的代码:弹簧引导,自定义登录页面,错误403
@Override
public void configure(HttpSecurity http) throws Exception{
http.authorizeRequests()
.anyRequest().authenticated()
.antMatchers("/index.html").permitAll()
.and()
.formLogin().usernameParameter("username")
.passwordParameter("password")
.loginProcessingUrl("/login")
.loginPage("/login")
.failureUrl("/login?error")
.permitAll()
.and()
.logout().permitAll();
}
发送POST网址:本地主机:8888 /登录
PARAMS:用户名,密码
响应:403
错误消息:
此应用程序没有明确的映射为/错误,所以您将此视为后备。
有一个意外的错误(type = Forbidden,status = 403)。
未找到预期的csrf标记。你的会话过期了吗?