- 浏览: 208629 次
- 性别:
- 来自: 杭州
最新评论
-
李嘉图0624:
第一段代码就出错了,少了g.close();不关闭的话,也没有 ...
Jackson 入门 -
daichangfu:
不光是生僻字需要,正常的也需要啊。
解决Java应用在Linux下无法正常水印生僻字 -
yaoweinan:
不错
JGroup配置笔记 -
learnworld:
grandboy 写道我想json的数据多一些对于数据绑定回j ...
Jackson 入门 -
grandboy:
我想json的数据多一些对于数据绑定回javabean时不会出 ...
Jackson 入门
转到Architecture Team后接手了公司的Framework, 单点登录也就落到我头上了.
公司最开始使用的策略是基于Tomcat 的Realm SSO, 这种策略的缺点是所有应用都必须放在同一个Tomcat下面, 放到不同Tomcat下都必须再做一次登录.
非常不利于HA.
(一)转到Architecture Team后我就向SDC的头提议了CAS的SSO策略.
1) The user choose to visit AMS
2) When the user arrived, AMS will first check to see if the user is authenticated by trying to locate a service ticket. if not, the framework on which the AMS built will redirect the user to the login page
3) Then Framework will ask the user to enter username and password which can identify herself/himself
4) If authentication passed, the user will be redirected back to AMS
5) The user is granted to visit AMS
6) If at some time during the same session the user serfs the BMS’ page with a ticket
7) BMS will first check to see if the user is authenticated by trying to locate a service ticket. And it found one, but it doesn’t know whether it’s valid, so it ask CAS to check it out
8) Validation pass
9) BMS is granted to visit.
检验一种方法的好坏是看它是否满足实际需要, 这种策略扩展性很好, 但是却需要独立部署一个中央认证系统. 公司非常不希望增加一个潜在的单点故障. 所以这个策略没被采纳.
(二) 不知什么原因, 后来SSO被外包公司负责. 他们提供了另外一种方案, 还是基于Tomcat, 利用Domain Cookie, 修改自己的Realm Authenticator, 可以提供真正的SSO体验. 最大的缺点是不同的Web Container要实现一整套不同的实现.
(三) 我自然对方案(二)很不满意. 吸取(二)的优点, 提出了以下方案. 基于Spring Security 2.0, 提供自己的SSOTicketFilter和SSOAuthenticationFilter. SSOAuthenticationFilter负责本地用户认证, SSOTicketFilter负责跨系统用户认证. SSOAuthenticationFilter在用户通过验证后保存Ticket. 跨系统时另一个系统由于也是采用Framework, 它也就会用同样的SSOTicketFilter实现来检验用户提供的Ticket. 经过验证, 方案(三)能够提供真正的SSO体验, 公司最终采取了这个方案.
以下样例配置:
<?xml version="1.0" encoding="UTF-8"?> <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-2.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd"> <beans:bean id="springSecurityFilterChain" class="org.springframework.security.util.FilterChainProxy"> <beans:property name="filterChainMap"> <beans:map> <beans:entry key="/**"> <beans:list> <beans:ref local="httpSessionContextIntegrationFilter" /> <beans:ref local="logoutFilter" /> <beans:ref local="ssoTicketProcessingFilter" /> <beans:ref local="ssoAuthenticationProcessingFilter" /> <beans:ref local="exceptionTranslationFilter" /> <beans:ref local="filterSecurityInterceptor" /> </beans:list> </beans:entry> </beans:map> </beans:property> </beans:bean> <beans:bean id="httpSessionContextIntegrationFilter" class="org.springframework.security.context.HttpSessionContextIntegrationFilter"> </beans:bean> <beans:bean id="exceptionTranslationFilter" class="org.springframework.security.ui.ExceptionTranslationFilter"> <beans:property name="authenticationEntryPoint" ref="authenticationProcessingFilterEntryPoint"> </beans:property> </beans:bean> <beans:bean id="ssoAuthenticationProcessingFilter" class="sso.SsoAuthenticationProcessingFilter"> <beans:property name="authenticationManager" ref="authenticationManager"></beans:property> <beans:property name="defaultTargetUrl" value="/index.jsp"></beans:property> <beans:property name="authenticationFailureUrl" value="/login.jsp"></beans:property> <beans:property name="invalidateSessionOnSuccessfulAuthentication"> <beans:value>true</beans:value> </beans:property> </beans:bean> <beans:bean id="authenticationProcessingFilterEntryPoint" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilterEntryPoint"> <beans:property name="loginFormUrl" value="/login.jsp"></beans:property> </beans:bean> <beans:bean id="filterSecurityInterceptor" class="org.springframework.security.intercept.web.FilterSecurityInterceptor"> <beans:property name="authenticationManager" ref="authenticationManager" /> <beans:property name="accessDecisionManager" ref="accessDecisionManager"></beans:property> <beans:property name="objectDefinitionSource"> <!-- <filter-invocation-definition-source> <intercept-url pattern="/secure/super/**" access="ROLE_WE_DONT_HAVE" /> <intercept-url pattern="/secure/**" access="ROLE_SUPERVISOR,ROLE_TELLER" /> </filter-invocation-definition-source> --> <beans:value> CONVERT_URL_TO_LOWERCASE_BEFORE_COMPARISON PATTERN_TYPE_APACHE_ANT /auth/login.action=ROLE_ANONYMOUS,ROLE_SUPERVISOR,ROLE_TELLER /**/*.action=ROLE_SUPERVISOR,ROLE_TELLER /**=ROLE_ANONYMOUS,ROLE_SUPERVISOR,ROLE_TELLER </beans:value> </beans:property> </beans:bean> <beans:bean id="accessDecisionManager" class="org.springframework.security.vote.AffirmativeBased"> <beans:property name="decisionVoters"> <beans:list> <beans:ref local="voter"></beans:ref> <beans:bean class="org.springframework.security.vote.AuthenticatedVoter" /> </beans:list> </beans:property> </beans:bean> <beans:bean id="voter" class="org.springframework.security.vote.RoleVoter"> </beans:bean> <beans:bean id="ssoTicketProcessingFilter" class="sso.SsoTicketProcessingFilter"> <custom-filter after="CAS_PROCESSING_FILTER" /> <beans:property name="authenticationManager" ref="authenticationManager" /> <beans:property name="defaultTargetUrl" value="/index.jsp"></beans:property> <beans:property name="authenticationFailureUrl" value="/j_spring_security_check"></beans:property> <beans:property name="invalidateSessionOnSuccessfulAuthentication"> <beans:value>true</beans:value> </beans:property> </beans:bean> <beans:bean id="logoutFilter" class="org.springframework.security.ui.logout.LogoutFilter"> <beans:constructor-arg> <beans:value>/login.jsp</beans:value> </beans:constructor-arg> <beans:constructor-arg> <beans:list> <beans:bean class="org.springframework.security.ui.logout.SecurityContextLogoutHandler"></beans:bean> <beans:bean class="sso.CleanTicketLogoutHandler"></beans:bean> </beans:list> </beans:constructor-arg> </beans:bean> <authentication-manager alias="authenticationManager" /> <beans:bean id="casAuthenticationProvider" class="sso.SsoAuthenticationProvider"> <custom-authentication-provider /> <beans:property name="userDetailsService" ref="userDetailsService" /> </beans:bean> <user-service id="userDetailsService"> <user name="rod" password="rod" authorities="ROLE_SUPERVISOR, ROLE_USER, ROLE_TELLER" /> <user name="dianne" password="dianne" authorities="ROLE_USER,ROLE_TELLER" /> <user name="scott" password="scott" authorities="ROLE_USER" /> <user name="peter" password="peter" authorities="ROLE_USER" /> </user-service> </beans:beans>
评论
另外, 应用一次性的Ticket策略提高系统的安全性. 以下是正式描述:
1) Adopted one-time ticket authentication strategy instead of cookie strategy
and get rid of cookie domain constraints.
It uses one-time ticket to strengthen the security of the authentication. The unique ticket will be renewed after the operator
passes the authentication, including normal login authentication and SSO login authentication. The unique ticket will be
invalidated after the operator logs out
发表评论
-
开发新手通用代码问题
2011-06-04 06:32 13168最近辅导黄埔的同学进行开发,发现了一些问题,隐约看到当年自己写 ... -
jmockit 的使用系列
2010-12-13 21:30 94171. 入门 2. 完整的Mock步骤 ... -
jmockit 的使用示例-02完整的Mock步骤
2010-12-13 21:11 4876package jmockit.sample; impo ... -
jmockit 的使用示例-03全部mock的?
2010-12-13 21:11 3644package jmockit.sample; impo ... -
jmockit 的使用示例-04静态部分mock示例
2010-12-13 21:10 3862package jmockit.sample; impo ... -
jmockit 的使用示例-06私有成员的Mock
2010-12-13 21:10 7652目标测试代码 package jm ... -
jmockit 的使用示例-07私有静态成员Mock
2010-12-13 21:09 4690目标测试代码 package jmockit.target ... -
jmockit 的使用示例-09构造方法也可以Mock?基于状态的Mock?
2010-12-13 21:07 10376目标测试代码 package jmockit.target ... -
jmockit 的使用示例-10另一种基于状态的Mock,随穿随脱?
2010-12-13 21:07 2705目标测试代码 package jm ... -
jmockit 的使用示例-11不是吧,还能访问实际被Mock的对象?
2010-12-13 21:07 3231目标测试代码 package jmockit.target ... -
jmockit 的使用示例-07私有静态成员Mock
2010-12-13 20:40 5889目标测试代码 package jmockit.target ... -
jmockit 的使用示例-02完整的Mock步骤
2010-12-13 20:31 1462package jmockit.sample; impo ... -
开放的心态
2010-10-02 13:56 981今天看李笑来的《把时间当作朋友》,看到一句话,“我们的大脑 ... -
Jackson 入门
2010-09-15 07:17 6492同事的一些测试结果看来,Jackson在处理Json方面性能相 ... -
解决Java应用在Linux下无法正常水印生僻字
2010-04-10 13:46 5616昨天接到一个投诉,说是他的水印是一个方框。刚开始还以为是程序出 ... -
同学们,秒投简历啦!
2010-03-12 23:51 221公司业务急速扩张,急需有才能的同学加入到我们的行列中, ... -
反编译工具
2009-12-31 20:54 1132追查JVM崩溃过程中使用到的反编译工具,其中beanutils ... -
追查JVM崩溃
2009-12-31 20:25 2240JDK升级到1.6后,服务器集群经常崩溃,后来把VM的参 ... -
普通用户下实现Apache 2.2.14与jboss-5.1.0.GA集成
2009-11-29 23:05 2766Apache与jboss集成,实际是apache与tomcat ... -
swt 笔记
2009-11-27 00:24 891http://www.ibm.com/developerwor ...
相关推荐
单点登录是目前比较流行的企业业务整合的解决方案用户只需要登录一次就可以访问所有相互信任的应用系统。
单点登录(Single Sign On),简称为 SSO,是目前比较流行的企业业务整合的解决方案之一。SSO的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统
NULL 博文链接:https://572327713.iteye.com/blog/2356519
单点登录(Single Sign On),简称为 SSO,是目前比较流行的企业业务整合的解决方 案之一
NULL 博文链接:https://zgq456.iteye.com/blog/2192979
rubycas-server, 为web应用提供 单点登录(Single Sign-On) 认证,实现Jasig协议的服务器端 rubycas服务器版权Matt Zukowski贡献的部分是版权所有( c ) 2011 Urbacon有限公司。 其他部分是他们各自作者的版权。作者请...
单点登录(SSO)的技术被越来越广泛地运用到各个领域的软件系统当中
SSO (Single Sign-On) 基于YMP框架实现的单点登录服务模块
LDAP eSSO Single Sign On
自定义的单点登录系统,可返回各个子系统的登录页及支持CAS Server集群。(https://github.com/liyingqiao121727/single-sign-on-v2)
本文中作者给大家详细的演示了如何实现WebSphere服务器和webpshere服务器之间的SSO(“单点登录、全网漫游”),并且给大家详细地解释了实现过程中的关键点和相关选项的含义,并且给出了开发带有安全性能要求的web...
django-mama-cas, Django 中央身份验证服务( CAS ) 单点登录(Single Sign-On) 服务器 MamaCAS MamaCAS是 Django 中央认证服务( CAS ) 单一登录和单一注销服务器。 它实现了 CAS 1.0.2.0和 3.0协议,包括一些可选的...
单点登录(Single Sign On , 简称 SSO )是目前比较流行的服务于企业业务整合的解决方案之一, SSO 使得在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统。CAS(Central Authentication ...
单点登录(Single Sign On , 简称 SSO )是目前比较流行的服务于企业业务整合的解决方案之一, SSO 使得在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统。CAS(Central Authentication ...
主要介绍了SpringBoot整合SSO(single sign on)单点登录,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
SSO 也称为单点登录,就是就是通过用户的一次性鉴别登录,即可获得需访问系统和应用软件的授权,在此条件下,管理员无需修改或干涉用户登录就能方便的实施希望得到的安全控制。 随着信息技术和网络技术的发展,各种...
SSO 也称为单点登录,就是就是通过用户的一次性鉴别登录,即可获得需访问系统和应用软件的授权,在此条件下,管理员无需修改或干涉用户登录就能方便的实施希望得到的安全控制。 随着信息技术和网络技术的发展,各种...
单点登录,Single Sign On,也就是我们平时所说的SSO。一般大型的系统平台,都会用到这个东西。它解决了频繁登录、验证的过程,也就是用户的一次登录得到其他系统的信任。可以说:一次登录,全站漫游。实现单点登录...
单点登录(Single Sign On),简称为 SSO。SSO的定义是在多个应用系统中,用户只需要登录一次就可以访问所有相互信任的应用系统。 在Microsoft Office SharePoint Server 2007中提供了实现单点登录的功能。