温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

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

发布时间:2020-08-10 18:55:12 来源:ITPUB博客 阅读:251 作者:zenzuguo 栏目:编程语言

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容器中获得有用的登录信息。 用户名和角色是由容器设置的。

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

4.需要注意的点


public class User implements Serializable, UserDetails
public class UserDaoHibernate extends GenericDaoHibernate implements UserDao, AuthenticationUserDetailsService

springsecuritypreauth.zip

[@more@]
向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI