入门客AI创业平台(我带你入门,你带我飞行)
博文笔记

spring boot csrf

创建时间:2017-03-26 投稿人: 浏览次数:1730
Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.

Sun Mar 26 22:46:00 CST 2017
There was an unexpected error (type=Forbidden, status=403).
Could not verify the provided CSRF token because your session was not found.

解决办法1:关闭csrf
添加:http.csrf().disable();

protected void configure(HttpSecurity http) throws Exception {
        http.authorizeRequests()
                .anyRequest().authenticated()
                .and().formLogin().loginPage("/login").failureUrl("/login?error").permitAll()
                .and()
                .logout()
                .permitAll();
        http.csrf().disable();

    }

正在寻求其他解决办法

声明:该文观点仅代表作者本人,入门客AI创业平台信息发布平台仅提供信息存储空间服务,如有疑问请联系rumenke@qq.com。