具有 Spring 安全性和 Angular - 重定向循环的 CAS SSO
CAS SSO with Spring Security and Angular - Redirect Loop
我正在努力在我的 spring 启动应用程序上实现 CAS SSO,并确保 spring 安全。 Angular 个静态文件在同一个 tomcat 服务器上提供。当我尝试导航到我的应用程序时,我陷入了重定向循环。就像CAS登录后不知道去哪里return。这是我遵循的例子:
https://www.baeldung.com/spring-security-cas-sso
如果我放置 .permitAll,我的应用程序可以运行(因为它完全跳过了 CAS。)所以应用程序可以运行,并且 CAS 看起来可以运行,但永远不会返回到请求的页面。有什么建议吗?
谢谢!
想通了!原来我需要允许 /login/cas url,然后保护其余部分。看起来像这样:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.antMatcher("/login/cas")
.permitAll()
.antMatcher("/**")
.authenticated()
...
;
}
我正在努力在我的 spring 启动应用程序上实现 CAS SSO,并确保 spring 安全。 Angular 个静态文件在同一个 tomcat 服务器上提供。当我尝试导航到我的应用程序时,我陷入了重定向循环。就像CAS登录后不知道去哪里return。这是我遵循的例子:
https://www.baeldung.com/spring-security-cas-sso
如果我放置 .permitAll,我的应用程序可以运行(因为它完全跳过了 CAS。)所以应用程序可以运行,并且 CAS 看起来可以运行,但永远不会返回到请求的页面。有什么建议吗?
谢谢!
想通了!原来我需要允许 /login/cas url,然后保护其余部分。看起来像这样:
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.antMatcher("/login/cas")
.permitAll()
.antMatcher("/**")
.authenticated()
...
;
}