【问题标题】:Problems while implementing SSO with Spring Security CAS extension使用 Spring Security CAS 扩展实现 SSO 时的问题
【发布时间】:2013-10-25 21:31:47
【问题描述】:

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

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

Spring Security 和 CAS deployerContext 配置 - http://pastie.org/8408976http://pastie.org/8408967

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

    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 server 3.5.2 版本。 任何指针都会有所帮助。

【问题讨论】:

    标签: spring-security cas jasig spring-security-cas


    【解决方案1】:
    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 中提取该字符串,因此要弄清楚它有点困难。

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

    【讨论】:

      猜你喜欢
      • 2011-03-17
      • 2015-12-28
      • 2012-05-18
      • 1970-01-01
      • 2018-02-05
      • 2013-05-25
      • 2011-11-11
      • 2013-07-21
      • 1970-01-01
      相关资源
      最近更新 更多