Spring Security如何在两个域上进行单次登录? [英] How can do single login with spring security on two domains?

查看:36
本文介绍了Spring Security如何在两个域上进行单次登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Web应用程序,并且有两个域-example.com和example.ru

I have web application and two domains for it - example.com and example.ru

example.com-适用于国际

example.com - for international

example.ru-适用于本地国家/地区

example.ru - for local country

我的Web应用程序使用Spring Security来授权用户,但是如果用户通过example.ru上的example.com登录,则不会登录.

My web app using spring security for authorization users but if user login through example.com on example.ru he isn't logged.

如果用户通过example.com或example.ru登录,他将在两个域上登录怎么办?

How can do that if user login through example.com or example.ru he will be logged on both domains?

PS:顺便说一句,我的Web应用程序通过OpenID和OAuth使用授权

PS: BTW my web application use authorization through OpenID and OAuth

推荐答案

如上所述,您需要一个单一的登录解决方案, Cloudseal 提供了一个spring安全扩展,其中包括spring命名空间,因此您只需要执行以下操作即可:

As mentioned you need a single sign on solution, Cloudseal provides a spring security extension which includes a spring namespace so you just need to do something like:

<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-登录

这篇关于Spring Security如何在两个域上进行单次登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆