我写了一个小型的spring security oauth provider(应用程序ID)spring boot starter并尝试对其进行测试https://github.com/yharish991/appid-spring-boot-starter
这是我的安全配置的样子
@EnableWebSecurity(debug = true)
public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/login**", "/user").authenticated()
.and().logout().logoutSuccessUrl("/")
.permitAll()
.and()
.oauth2Login();
}
}
问题是身份验证成功后,该应用程序始终会再次再次重定向到登录页面,并且Principal对象始终为空