我有Web应用程序,并且有两个域-example.com和example.ru
example.com-适用于国际
example.ru-适用于本地国家
我的Web应用程序对授权用户使用spring security,但是如果用户通过example.ru上的example.com登录,则不会登录。
如果用户通过example.com或example.ru登录,该怎么办?他将同时在两个域上登录?
PS:顺便说一句,我的Web应用程序通过OpenID和OAuth使用授权
最佳答案
如前所述,您需要一个单一的登录解决方案,Cloudseal提供了一个spring安全扩展,其中包括spring命名空间,因此您只需要执行以下操作即可:
<security:http entry-point-ref="cloudseal">
<security:intercept-url pattern="/protected/user.do" access="IS_AUTHENTICATED_FULLY" />
<security:intercept-url pattern="/protected/admin.do" access="ROLE_ADMIN" />
</security:http>
<cloudseal:sso endpoint="http://cloudseal.com" entry-point-id="cloudseal" app-id="quickstart">
<cloudseal:keystore location="WEB-INF/keystore.jks" password="nalle123">
<cloudseal:key name="apollo" password="nalle123" />
</cloudseal:keystore>
<cloudseal:metadata location="WEB-INF/idp.xml" />
</cloudseal:sso>
参见www.cloudseal.com/platform/spring-security-single-sign-on