sso与spring security整合预认证场景PreAuthenticated

1。当前项目的有个要求,sso与spring security结合使用
2。使用spring security的“预认证场景”PreAuthenticated
参考文档http://www.family168.com/tutorial/springsecurity/html/springsecurity.html

3。下载spring security的源代码。参考3.5。Pre-Authentication例子
个例子演示了如何从Pre-Authentication框架绑定bean从J2EE容器中获得有用的登录信息。用户名和角色是由容器设置的。

代码在样品/preauth目录下。
主要需要重写的类
RequestHeaderAuthenticationFilter (sso认证跳入本应用系统后,首先到这个类进行用户权限加载和验证,
不一定所有sso用户都能访问本子系统)
UserLoginInterceptor(加载资源,像对具体的模块有一些什么样的具体的CRUD权限)

4。需要注意的点

<属性名=" rolePrefix " value="/>

公开课用户实现了Serializable, UserDetails
公共类UserDaoHibernate延伸GenericDaoHibernate <用户,长>实现UserDao AuthenticationUserDetailsService springsecuritypreauth.zip

[@more@]

sso与spring security整合预认证场景PreAuthenticated