使用弹簧安全性 CAS 扩展实现 SSO 时出现问题



我正在尝试使用 Spring Security CAS 扩展来验证我的应用程序上的用户。以前只有一个应用程序,因此不需要 SSO。现在还有一个应用程序,我希望用户登录一次并使用所有应用程序,而无需再次进行身份验证(基本上是 SSO)。我有一堆这样的问题——

  • 我拥有的所有应用程序都是单个 tomcat 容器的一部分,将通过同一域提供服务。我检查了Tomcat SSO阀门,但它似乎需要基于容器的身份验证,我不确定我是否要将其用于身份验证/授权。我正在使用基于弹簧安全表单的登录。我真的需要像Jasig CAS这样的东西还是矫枉过正?

Spring 安全性和 CAS 部署程序上下文配置 - http://pastie.org/8408976 和 http://pastie.org/8408967

  • 我用Jasig服务器设置了Spring Security CAS,SSO似乎可以工作,因为登录到任何应用程序就足以访问其他应用程序。我修改了deployerConfigContext.xml将inMemoryServiceRegistryDaoImpl替换为JPA/Hibernate。但我总是在我的日志中看到以下行。虽然表已经在我的数据库中创建(服务票等)。当我尝试登录和注销时,这些表始终为空。

    2013-10-17 16:41:18,882 INFO [org.jasig.cas.services.DefaultServicesManagerImpl] - <Loaded 0 services.>

  • 当我尝试访问 URL https://localhost/cas/services 时,它会返回错误"此网站具有重定向循环"。 我看到下面的片段在日志中重复了 n 次(票号不同)-http://pastie.org/8408940

  • 我没有任何 REST 或无状态服务访问经过身份验证的资源,我是否需要代理票证?

注意:我使用的是Spring Security 3.1.4.RELEASE和CAS服务器3.5.2版本。任何指针都会有所帮助。

I set up Spring Security CAS with Jasig server and SSO seems to work
   as logging in to any of the applications suffices to access the other
   application. I've modified the deployerConfigContext.xml to replace
   the inMemoryServiceRegistryDaoImpl with JPA / Hibernate one. But I
   always see the below line in my logs. Though the tables have been
   created (SERVICETICKET and so on) in my db. These tables are always
   empty when I try logging in and out.
When I try to access URL `https://localhost/cas/services`, it returns an error "This website has a redirect loop". and I see the

下面的片段在日志中重复 n 次(具有不同的 票号)

我想出了解决这个问题的方法。这是因为 CAS 服务器配置中的 filterProcessesUrl 具有字符串"acegi"(Spring Security 的旧名称),该字符串与"spring"不匹配,因此存在问题。修改它有所帮助。不知道为什么旧名字在那里被硬编码。 此外,它没有从cas.properties中获取此字符串,因此弄清楚它有点困难。

我希望得到其他问题的答案。

最新更新