-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UserInfoHolder(Required):获取当前登录用户信息,SSO一般都是把当前登录用户信息放在线程ThreadLocal上 #2607
Comments
我在Filter中,如果 通过,则: set authentication,如下: SecurityContextHolder.getContext().setAuthentication(new Authentication() {
然后,再在 UserInfoHolder的实现类中 get authentication,如下: 这样应该可以吧? |
接入SSO的思路如下,ctrip的实现使用反射是因为不想让开源代码依赖内部的jar包。
|
弱弱地问下,阿波罗目前有没有开箱即用的SSO接口,可以让我不修改阿波罗程序就可以单点登入到阿波罗呀? |
sso有多种实现,所以目前没有标准开箱即用的方式,ldap是有的。 |
好的,感谢 |
UserInfoHolder(Required), 我的 这个最终实现是: 1. 增加一个类 CustomThreadLocal, 里面有一个public static final ThreadLocal sThreadLocal; 2. Filter如果验证通过,那么 sThreadLocal.set(userInfo); 3. 然后在UserInfoHolder的实现类中,直接 sThreadLocal.get。 over. |
你们最后实现SSO了么 |
您好, CustomThreadLocal 的代码能参考下么 |
这个描述太模糊了吧,我看Ctrip的实现,也是用了一堆的反射,还是调用的sso远程。
1 . 这个是查询本地的User,还是查询SSO的当前登录用户,还是先本地再SSO,如果是SSO,那么就会碰到问题2 ?
由于查不到UserInfoHolder.getUser被什么方法调用了,具体干什么用的,所以自己也无法做更多理解,是否可以替换为 带参数的 getUser(param) 。
The text was updated successfully, but these errors were encountered: