码云地址:https://gitee.com/lpxs/lp-springcloud.git
有问题可以多沟通:136358344@qq.com。
刚开始用springboot1.5集成oauth2没问题,现在升级成springboot2.1踩了不少坑,下面列举下:
问题一
Possible CSRF detected - state parameter was required but no state could be found
客户端代码
@EnableOAuth2Sso
@Configuration
public class UiSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(HttpSecurity http) throws Exception {
http.antMatcher("/**")
.authorizeRequests()
.antMatchers("/", "/login**")
.permitAll()
.anyRequest()
.authenticated();
}
}
在获取到code后一直停留在登陆页面上