【问题标题】:CAS SSO with Spring Security and Angular - Redirect Loop具有 Spring Security 和 Angular 的 CAS SSO - 重定向循环
【发布时间】:2021-02-03 17:41:56
【问题描述】:

我正在努力在我的 Spring Boot 应用程序上使用 Spring Security 实现 CAS SSO。 Angular 静态文件在同一个 tomcat 服务器上提供。当我尝试导航到我的应用程序时,我陷入了重定向循环。就好像CAS登录后不知道返回哪里一样,下面是我按照的例子:

https://www.baeldung.com/spring-security-cas-sso

如果我放一个 .permitAll,我的应用程序可以正常工作(因为它只是完全跳过了 CAS。)所以应用程序可以正常工作,CAS 看起来可以正常工作,但永远不会返回到请求的页面。有什么建议吗?

谢谢!

【问题讨论】:

    标签: angular spring spring-security cas


    【解决方案1】:

    想通了!原来我需要允许 /login/cas url,然后保护其余部分。看起来像这样:

    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http
          .antMatcher("/login/cas")
          .permitAll()
          .antMatcher("/**")
          .authenticated()
          ...
          ;
    }
    

    【讨论】:

      猜你喜欢
      • 2019-08-05
      • 2015-09-12
      • 2015-03-10
      • 1970-01-01
      • 2014-07-18
      • 2014-01-21
      • 2015-12-28
      • 1970-01-01
      • 2015-01-12
      相关资源
      最近更新 更多