2012-07-24 110 views
0

我有两个应用程序,每个应用程序位于它自己的服务器上。他们都使用Spring安全性和标准设置。 我需要通过第二个访问第一个应用程序的问题。登录第二个应用程序时,我需要发送密码并登录到第一个应用程序。 有人可以帮忙提供样品或技巧吗?谢谢。 我的弹簧security.xml文件中的两个应用程序:从第二个应用程序访问弹簧安全性

<beans:beans xmlns="http://www.springframework.org/schema/security" 
xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/security 
    http://www.springframework.org/schema/security/spring-security-3.1.xsd"> 

<http pattern="/favicon.ico" security="none" /> 

<http auto-config="true"> 
    <intercept-url pattern="/**" access="ROLE_ADMIN"/> 
</http> 

<authentication-manager> 
    <authentication-provider> 
     <user-service> 
      <user name="hey" password="there" authorities="ROLE_ADMIN" /> 
     </user-service> 
    </authentication-provider> 
</authentication-manager> 

回答

2

你应该使用CAS此,而不是试图访问或通过用户/跨应用程序通过。

请参考此link了解如何在这种情况下使用CAS。

+0

感谢您的回复,但也许有更简单的方法来解决这个问题?或者春季安全没有这种情况下的功能,以避免额外的插件?谢谢。 – me1111 2012-07-24 10:48:40

+1

另一个选项可以使用cookie来存储来自一个应用程序的授权细节,并要求其他应用程序使用记忆我。 – 2012-07-24 11:16:41

+0

我的错误,我忘了提及应用程序位于不同的服务器上。对不起,这种方式还有可能吗? CAS能够帮助吗? – me1111 2012-07-24 11:35:15