成功通过身份验证后,Spring Security会再次重定向到登录页面

时间:2019-10-21 16:15:37

标签: spring-boot spring-security spring-security-oauth2

我写了一个小型的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对象始终为空

0 个答案:

没有答案